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
c224cf72d8095e3af1d74aac88029ec1
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class Main { static FastScanner fs = new FastScanner(); static PrintWriter pw = new PrintWriter(System.out); static StringBuilder sb = new StringBuilder(""); public static void main(String[] args) { int t = fs.nextInt(); for (int...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
6ef529d9cc112869cb93e7600678286c
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
// package c1608; import java.io.File; import java.lang.invoke.MethodHandles; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.PriorityQueue; import java.util.Random; import java.util.Scanner; // // Codeforces Round 2021-12-11 02:05 // C. Game ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
2dd40488f69cabd482587044c817b4af
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class gotoJapan { public static void main(String[] args) throws java.lang.Exception { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream)...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
4a021d78d28c84af2077f79a8b4e9140
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.io.Writer; imp...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
fa0c3de732b0669092d8d0861c2900bf
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { ArrayList<Integer>[] graph; HashSet<Integer> set; void solve() { int n = in.nextInt(); int[] a = array(n, 1); int[] b = array(n, 1); Integer[] indexA = sort(a); Integer[] inde...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
38e1f6d3a48b8b4b576de850a45e7ead
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; import java.sql.Array; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.SQLIntegrityConstraintViolationException; public class Main { private static class MyScanner { private static final int BUF_SIZE = 2048;...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
07eda208887efdcf568cc771e0aea33b
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class CodeForces{ /*-------------------------------------------EDITING CODE STARTS HERE-------------------------------------------*/ public static void main(String[] args) throws IOException{ openIO(); int testCase = 1; testCase = sc.nextInt...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
32af8a1087201572f78ec9304b891a7b
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class CodeForces{ /*-------------------------------------------EDITING CODE STARTS HERE-------------------------------------------*/ public static void main(String[] args) throws IOException{ openIO(); int testCase = 1; testCase = sc.nextInt...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
237508f6878c959be33ed6e351e775aa
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
/* Rating: 1367 Date: 24-01-2022 Time: 17-11-22 Author: Kartik Papney Linkedin: https://www.linkedin.com/in/kartik-papney-4951161a6/ Leetcode: https://leetcode.com/kartikpapney/ Codechef: https://www.codechef.com/users/kartikpapney */ import java.util.*; import java.io.BufferedRe...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
b98e58305e2f391ae5e448062712f387
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class GameMaster { static int p; static boolean map1on; public static void main(String[] args) throws Exception { CustomScanner sc = new CustomScanner(); CustomPrinter cp = new CustomPrinter(); int T = sc.nextInt(); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
058a76ae1a300ace7272bb7ebd34a73c
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.util.stream.IntStream; import java.io.PrintWriter; import java.io.OutputStream; import java.util.Arrays; import java.io.IOException; import java.io.InputStreamReader; import java.io.FileNotFoundException; import java.util.s...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
c57276f961b8ecc0aa9712210bd36992
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; // Problem Link: https://codeforces.com/problemset/problem/1608/C public class game_master { public static int n; public static int[] canWin; public static void main (String[] args) throws IOException { // set up BufferedReader in = new BufferedReader(ne...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
4454ee29eb6092eb9800ba220bfa994d
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.util.Collection; import java.util.InputMismatchException; import java.io.IOException; import java.ut...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
99118bf390b7809bf9836f013d7e1da6
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.util.Collection; import java.util.InputMismatchException; import java.io.IOException; import java.util.ArrayLi...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
3bfcf48dd4bb4cac015f5a98b3656aae
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
cc1e581e53fd6ee94dd37f008cb156b0
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class C_1608 { static ArrayList<Integer>[] adjList; static char[] vis; public static void dfs(int u) { vis[u] = '1'; for(int v : adjList[u]) if(vis[v] == '0') dfs(v); } public static void main(String[] args) throws Exception { //Scann...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
531263ae1cf73905c885fc807b62919a
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; import java.util.concurrent.ScheduledExecutorService; import static java.lang.Math.*; import static java.lang.Math.ceil; import static java.util.Arrays.sort; public class C { public static void main(String[] args) throws IOException { int t = ri(); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
c30bf8417920f374cb73f5774299af94
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Main { static int[] ans; static int n; public static void main(String[] args) { FastScanner fs=new FastScanner(); PrintWriter out = new PrintWriter(System.out); /****** CODE STARTS HERE *****/ //-------------------------------------------...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
77d8a0fdd6defe1260c470d90ce9b8c3
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Main { static int[] ans; static int n; public static void main(String[] args) { FastScanner fs=new FastScanner(); PrintWriter out = new PrintWriter(System.out); /****** CODE STARTS HERE *****/ //-------------------------------------------...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
a343ce1554292788e51558e05727c037
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Main { static int[] ans; static int n; public static void main(String[] args) { FastScanner fs=new FastScanner(); PrintWriter out = new PrintWriter(System.out); /****** CODE STARTS HERE *****/ //-------------------------------------------...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
832a7a98bce3b23fde9efc01ed9bf87f
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class gameMaster { public static void main(String args[]) throws IOException { FastScanner in = new FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); int t = in.nextInt(); for ( ; t > 0; t--) { int n = in.nextInt(); int[][] a = ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
571ba5c67a117b71e7579509a4928504
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; /** * https://codeforces.com/contest/1608/problem/C * (input omitted due to length) */ public final class GameMaster { public static void main(String[] args) throws IOException { B...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
af13c60db7d2534dae1164637413b0c3
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.text.DecimalFormat; import java.util.Scanner; import java.util.*; public class Test1 { public static void main(String[] args) { Scanner in = new Scanner(System.in); // 测试次数 int testnum = in.nextInt(); for (int k = 0; k <testnum; k++) { int n = ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
efdb957621b42c770ba6b2d22c7c6a40
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.text.DecimalFormat; import java.util.Scanner; import java.util.*; public class Test1 { public static void main(String[] args) { Scanner in = new Scanner(System.in); // 测试次数 int testnum = in.nextInt(); for (int k = 0; k <testnum; k++) { int n = ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
35e8716f432e66adf5a4e175c4f298c6
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.OutputStreamWriter; import java.math.BigInteger; import java.math.BigDecimal; import java.math.MathContext; import java.math.RoundingMode; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Ar...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
de7e2c7ff09afd4269abeee5aedc389a
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main { static int MOD = 1000000007; // After writing solution, quick scan for: // array out of bounds // special cases e.g. n=1? // npe, particularly in maps // // Big numbers arithmetic bugs: // in...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
b1e6fee33afdbc3f7841b5aea8ebfa56
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; /** * Accomplished using the EduTools plugin by JetBrains https://plugins.jetbrains.com/plugin/10081-edutools * * To modify the template, go to Preferences -> Editor -> File and Code Templates -> Other */ public class Main { public static void main(String[] args) { i...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
dab544a1697d7734c237c005129fc3cb
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); StringBuilder sb = new StringBuilder(); for(int t = 0; t < T; ++t) { int n = in.nextInt(); int[] ans = new int...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
ff85e67e333f1ffd4d15e028f9d9aea5
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; import java.time.*; import static java.lang.Math.*; @SuppressWarnings("unused") public class C { static boolean DEBUG = false; static Reader fs; static PrintWriter pw; static void solve() { int n = fs.nextInt(), a[] = fs.readArray(n), b[] = fs.readArray(n); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
b0b3c2313308de3c5780cbd4fd3edd1d
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { // write your code here boolean readFromLocal = true; //readFromLocal = false; String filepath = "src/inp...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
da01b8ad57e1d014e09664ff7dd8aff1
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.math.BigInteger; import java.util.*; public class Main { public static void main(String[] args) { // write your code here boolean readFromLocal = true; //readFromLocal = false; String filepath = "src/inp...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
a632dba1b0a73b2627d4f5d7fc7eb455
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.System.out; import java.util.*; import java.io.*; import java.math.*; /* -> Give your 100%, that's it! -> Rules To Solve Any Problem: 1. Read the problem. 2. Think About It. ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
e8e17577ced9c6b1809e0dc8f6610b0f
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef {static class FastReader { BufferedReader br; StringTokenizer st; ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
369fb5e2680ee547efe0ce8d29e1463f
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Solution extends PrintWriter { void solve() { int t = sc.nextInt(); for(int i = 1; i <= t; i++) { test_case(); } } void test_case() { int n = sc.nextInt(); int[][] a = new i...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
ff4f45c0e9f333e3226df76c20491307
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Codeforces { public static void main(String args[])throws Exception { BufferedReader bu=new BufferedReader(new InputStreamReader(System.in)); StringBuilder sb=new StringBuilder(); int t=Integer.parseInt(bu.readLine()); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
33fdf493d63b19a06f890d5581edda0e
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class q3 { public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // public static long mod = 1000000007; public static class Pair{ int i; int a; int b; Pair(int i,int a){ ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
9ccfa57e0cb1a0c50ee632b16d64d1df
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
//some updates in import stuff import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.util.*; import java.io.*; import java.math.*; public class Main{ static int mod = (int) (Math.pow(10, 9)+7); static final int dx[] = { -1, 0, 1, 0 }, dy[...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
d107d4a0ee74e81c38ce26c4dbaf79e7
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.Comparator; import java.util.PriorityQueue; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws Exception { InputStream inputStream = System.in; OutputStream outputStream = System.out; ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
2806838b9d4023917776e37b0748f721
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class CF1562C extends PrintWriter { CF1562C() { super(System.out); } public static Scanner sc = new Scanner(System.in); public static void main(String[] $) { CF1562C o = new CF1562C(); o.main(); o.flush(); } static long calculate(long p, long q)...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
d823a74cb79a89c9d162fc48f0538b23
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Solution { public static long gcd(long a,long b) { if(a==0) return b; return gcd(b%a,a); } public static long lcm(long a,long b) { return (a*b)/gcd(a,b); } public static void main(String[] args) throws java.lang.Exception { BufferedReade...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
d441cdef2ca3efedffb46095ac9955f7
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { FastReader sc = new FastReader(); PrintWriter writer = new PrintWriter(System.out); long mod = 1000000007; int t = sc.nextInt(); while(t...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
7dc3b5038a9b35ff5b1cfdf189d060e8
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.InputMismatchException; import java.util.Scanner; public class gamemaster { private static class pair implements Comparable<pair> { int low, ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
262d9e32ab32fac030a4f07064112ce4
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.DataInputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.TreeMap; public class Main { private static int n; private static int[] a, b; private static TreeMap<Integer, Integer> a_map, b_map; private static boo...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
e7a9ba632254812928bca019c167588a
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class test { static StringBuilder sb; static long fact[]; static int mod = (int) (1e9 + 7); static class Pair implements Comparable<Pair> { int x; int y; Pair(int x, int y) { this.x = x; this.y = y; } public int c...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
69643d498811d5e5f304771f02ca50a9
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Div21608C { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); int t = In...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
f726f7ef75842905960e263b165f2d5a
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class _758 { public static void main(String[] args) { MyScanner sc = new MyScanner(); PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
686a07c1b5dff43cfa350564b1f32049
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class Main { // For fast input output static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { try {br = new BufferedReader( new FileReader("input.txt")); PrintStream out = new PrintStrea...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
eec60261c561d9b9792d227fcd0f0268
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.PriorityQueue; public class Main { public static void main(String[] args) { new Main(); } public Main() { FastScanner fs = new FastScanner(); java.io.PrintWriter out = new java.io.PrintWriter(System.out); solve(fs, out); out.flush(); } public void solve(FastScanner fs,...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
feba59a11ccb187d44a2b5dd45410097
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Main { static AReader scan = new AReader(); static int N = 100010; static Pair[] pa...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
31627e0929d4cd5042da1a433666de4e
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.util.*; public class Main { static InputReader2 sc=new InputReader2(System.in); /* static int MAXN=200005,n,m,a[]=new int[MAXN],dp[]=new int[MAXN],edge[][]=new int[MAXN][2]; static long k; static boolean vis[]=new boolean[MAXN...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
1d56ead54afada7002e6f8611fcd7eda
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class GameMaster { public static void main(String[] args) throws IOException{ BufferedReader f=new BufferedReader(new InputStreamReader(System.in)); PrintWriter out=new PrintWriter(System.out); int t=Integer.parseInt(f.readLine()); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
e64b7c7377bbc1f84cb7360f3b849219
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class GameMaster { public static void main(String[] args) throws IOException{ BufferedReader f=new BufferedReader(new InputStreamReader(System.in)); PrintWriter out=new PrintWriter(System.out); int t=Integer.parseInt(f.readLine()); while(t-->0) { int n=Integer.p...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
75ebf421b9064cb3c1f81bc717f32077
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.Arrays; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int k = input.nextInt(); Set<Integer> set = new HashSet<>(); while(k-- !=...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
ea0bfd9b48d47d59e1c50bec261a78e9
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Main { static class Pair implements Comparable<Pair>{ int i; int j; Pair(int i,int j){ this.i=i; this.j=j; } public int compareTo(Pair o){ if(this.j>o.j){ ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
bdbac73788db01a9aa86f9df90f2d381
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
/* 3 4 1 2 3 4 1 2 3 4 4 11 12 20 21 44 22 11 30 1 1000000000 1000000000 Put an edge from player a to player b iff a can defeat b, a player can win the tournament if you can reach all other players from it --> Can use DP from here to determine which of these players can win (if a player reaches a player th...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
8529cf67ca75f9d55da6e75ac34331c3
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class Main{ public static void main(String args[]){ InputReader in=new InputReader(System.in); TASK solver = new TASK(); int t=1; t = in.nextInt(); for(int i=1;i<=t;i++) { ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
41c101523abb8ca5dfb4810ff6abcc2e
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class cf1608c { public static void main(String[] args) throws IOException { int t = ri(); while (t --> 0) { int n = ri(), a[] = ria(n), b[] = ria(n), ai[][] = new ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
0fc64e0dd467057a69424438b50c2c96
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
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 time; static int mod= 998244353; static List<Integer> adj[]; static int v; static int sum...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
cf5993777fde0ddad5559e40aa1bdd33
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class GameMaster { public static void main(String[] args) throws Exception { FastIO in = new FastIO(); int t = in.nextInt(); for (int i=0; i<t; i++) { int n = in.nextInt(); ArrayList<ArrayList<Integer>> adj = new ArrayList<ArrayList<Integer>>(); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
144cff3a43c9ddcda3c1c6728eb075c0
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.InputMismatchException; public class E1608C { public static void main(String[] args) { FastIO io = new FastIO(); int t = io.nextInt(); while (t-- > 0) { int n = io.nextInt(); Triple[] arr = new Tri...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
ba7d74be24832a01307eef5c29210347
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class cf { static PrintWriter pw = new PrintWriter(System.out); public static void main(String[] args) throws IOException, InterruptedException { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t--> 0) { int n = sc...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
60917ed6fe39cf041fc7d738a2462170
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import java.math.*; public class Final { static final Reader s = new Reader(); static final PrintWriter out = new PrintWriter(System.out); public static vo...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
5332d11c0f4523d481f2780e53b371f8
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class C { static FastScanner fs = new FastScanner(); static PrintWriter pw = new PrintWriter(System.out); static StringBuilder sb = new StringBuilder(""); public static void main(String[] args) { int t = fs.nextInt(); for (int tt = 0; tt < t; tt...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
9299655097f68ff9947ef10198f8b46d
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static Scanner sc = new Scanner(System.in); // static Reader sc = new Reader(); static StringBuilder out = new StringBuilder(); static String testCase = "Case #"; static long mod = 998244353; public static void main(String[] args)...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
b976f5d999a729e74a2cb33c0ede8181
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.Comparator; import java.util.InputMismatchException; import java.util.StringTokeniz...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
16b9a566697a2b7c86d55d0104c98730
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Main { InputStream is; FastWriter out; String INPUT = ""; void run() throws Exception { is = System.in; out = new FastWriter(System.out); solve(); out.flush(); } public static void main(String[] args) throws Exception { new Main().run(); } private byte[] inbuf = new by...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
0cadd8381a78b6ad0cfe8a0acf85c095
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class c { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int numcases = Integer.parseInt(in.readLine()); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
19ae7cc884adfc9716b4fb00faedfac2
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; // THIS TEMPLATE MADE BY AKSH BANSAL. public class Solution { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
009d5b5ee5072787128f084511c8d9db
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class solve { static boolean[]ans; static ArrayList<Integer>[]graph; static void dfs(int node) { ans[node]=true; for(int i:graph[node]) { if(!ans[i])dfs(i); } } public static void main(String[] args) throws Exception { int t=sc.nextInt(); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
4f1c4256f5cc2b654f46524201002162
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class CMain { private boolean[] used; public static void main(String[] args) { QuickReader in = new QuickReader(System.in); try(PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out));) { new CMain().solve(in, out); } } ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
68c69aeb1b21274a72a7ed54ba7525d0
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(); PrintWriter out = new PrintWriter(System.out); int tc=sc.nextInt(); while (tc-->0){ int n=sc.nextInt(); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 11
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
e9a283587114ab85f593984e3b93fc52
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class Code { static StringBuffer st...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
4932caffc40b5be2f17db7b125a860f5
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
/* Goal: Become better in CP! Key: Consistency and Discipline Desire: SDE @ Google USA Motto: Do what i Love <=> Love what i do If you don't use your brain 100%, it deteriorates gradually */ import java.util.*; import java.io.*; import java.math.*; public class Code { static StringBuffer st...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
7690e0ff011dc49874b4f140c536cd94
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
/* Challenge 1: Newbie to CM in 1year (Dec 2021 - Nov 2022) 🔥 5* Codechef Challenge 2: CM to IM in 1 year (Dec 2022 - Nov 2023) 🔥🔥 6* Codechef Challenge 3: IM to GM in 1 year (Dec 2023 - Nov 2024) 🔥🔥🔥 7* Codechef Goal: Become better in CP! Key: Consistency! */ import java.util.*; import ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
e828e9fe152235072af3969d0bcbb2f0
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class new1{ public static void dfs(ArrayList<ArrayList<Integer>> aList, int u, int[] vis) { vis[u] = 1; for(Integer x : aList.get(u)) { if(vis[x] == 0) { dfs(aList, x, vis); } } } public static void main(String[] args) throws IOExceptio...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
79f3796714788ce0ffd5e11b3cc1f222
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class A { //--------------------------INPUT READER---------------------------------// static class fs { public BufferedReader br; StringTokenizer st = new StringTokenizer(""); public fs() { this(System.in); } public fs(Inpu...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
59cf0b525ed9cac2e74916d95e65f79f
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
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(); Player[] a=new Player[n+1]; Player[] b=new Player[n+1]; ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
fe03005786ff7b55f5aefa5c6f689b20
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
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(); Player[] a=new Player[n+1]; Player[] b=new Player[n+1]; ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
7de47ba01e1a46a9a1de94149d29fd21
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class Main { static FastScanner sc = new FastScanner(System.in); static PrintWriter pw = new PrintWriter(System.out); static StringBuilder sb = new StringBuilder(); static long mod = (long) 1e9 + 7; public static void main(String[] args) throws...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
61a2eb59caae524f2f5fa2437b7aaf8d
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class E{ static FastScanner fs = null; static int vis[]; static int mx = -1; static ArrayList<ArrayList<Integer>> list; static ArrayList<ArrayList<Integer>> rev; public static void main(String[] args) { fs = new FastScanner(); PrintWriter out = new PrintW...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
abddfd58c8e19656315a6eff7fdbbb2e
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
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.*; public class x1608C { static ArrayDeque<Integer>[] e...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
68119e12a55d29c47fef05ef5de10a95
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
/* || श्री राम समर्थ || || जय जय रघुवीर समर्थ || */ import java.io.IOException; import java.io.InputStream; import java.io.PrintStream; import java.io.PrintWriter; import java.util.*; import static java.util.Arrays.sort; pub...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
9ef58846ce41d616abca0e0d292b5352
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
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
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
c6bae21dfd59e517cc42daff9b778f16
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
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.util.*; import java.util.concurrent.ThreadLocalRandom; public class a729 { public static void main(String...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
5c593032c985394229670ad352083faa
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.Arrays; public class ybg{ public static void main(String[]args) { FastScanner c = new FastScanner(); int a = c.nextInt(); for(int aa=0;aa<a...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
7b8b9decf2d5d7a55fc5abd43001f042
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import static java.lang.Math.PI; import static java.lang.System.in; import static java.lang.System.out; import static java.lang.System.err; public class C { static ArrayList<ArrayList<Integer>> adj; static void dfs(int s, ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
68b4081fdb1950926c640b9d7815c103
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class solution { public static void main(String[] args) { FScanner sc = new FScanner(); //Arrays.fill(prime, true); //sieve(); int t=sc.nextInt(); StringBuilder sb = new StringBuilder(); while(t-->0) { int n=sc.nextInt(); ArrayList<pair> a=new Ar...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
7903d2d7f18444014c838176936c2824
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; public class GameMaster { static Scanner scanner = new Scanner(System.in); public static void main(String[] args) { int T = scanner.nextInt(); while (T -- > 0) { int n = scanner.nextInt(); Pair[] ps1 = new Pair[n]; Pair[] ps2 ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
5a3ff6d196b51c0d9aca87a111ca7c08
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; // import java.lang.*; // import java.math.*; public class Main { static FastReader sc=new FastReader(); static PrintWriter out=new PrintWriter(System.out); static long mod=1000000007; // static long mod=998244353; static int MAX=Integer.MAX_VALUE; static int M...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
b8c7c62fced34bc48737c7d04a5c450e
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
// Main Code at the Bottom import java.util.*; import java.io.*; import java.sql.Time; public class Main implements Runnable{ //Fast IO class static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { boolean env=System.getProperty("ONLINE_J...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
31d038e4c6efa878752b47dc228dab41
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; public class Main { public static void main(Stri...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
d9c30b20fd5eddf704ea2652d299a753
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; public class Main { public static void main(Stri...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
b29926353fb01802eaa5eadfb612e553
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; public class Main { public static void main(Stri...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
ebfee4429a55ec6ec9742278d4eb2bb3
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class C { public static void main(String[] args) { for (int t = IO.nextInt(), i = 0; i < t; i++) new SolC().solve(); IO.close(); } } class SolC { int n; int[] a, b; Integer[] id; Map<Integer, int[]> graph; boolean...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
b28392ca267eee1e7c72c82b72a8113f
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class GameMaster { public static PrintWriter out; public static void main(String[] args)throws IOException { JS sc=new JS(); out = new PrintWriter(System.out); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); int a[]=new int[n];...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
1d67560a6217e813f2478465e0fd28b3
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class GameMaster{ static long mod = 1000000007L; static MyScanner sc = new MyScanner(); static void solve() { int n = sc.nextInt(); PriorityQueue<Pairs> pq1 = new PriorityQueue<>(); PriorityQueue<Pairs> pq2 = new PriorityQueue<>();...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
1120326b32be1f2568487f42ffab9f67
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class Main{ static Scanner sc = new Scanner(new BufferedInputStream(System.in)); static int sc(){return sc.nextInt();} static long scl(){return sc.nextLong();} static double scd(){return sc.nextDouble();}; static String scs(){return sc.next();}; ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
ad5e55d832b8ce8512c671fae6313ee5
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.io.*; public class Main{ static Scanner sc = new Scanner(new BufferedInputStream(System.in)); static int sc(){return sc.nextInt();} static long scl(){return sc.nextLong();} static double scd(){return sc.nextDouble();}; static String scs(){return sc.next();}; ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
d3ba235814fe6b7790b860b112231c8a
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.io.*; import java.util.*; public class C1608{ public static void main(String[] args)throws IOException{ BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int t = Integer.parseInt(f.readLine()); ...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output
PASSED
4404fefa7e0b1119846627a53a134c83
train_109.jsonl
1639217100
$$$n$$$ players are playing a game. There are two different maps in the game. For each player, we know his strength on each map. When two players fight on a specific map, the player with higher strength on that map always wins. No two players have the same strength on the same map. You are the game master and want to o...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Codechef { static long fans[] = new long[200001]; static long inv[] = new long[200001]; static long mod = 1000000007; static void init() { fans[0] = 1; inv[0] = 1; fans[1] = 1; inv[1] = 1; for (int i = 2; i < 200001; i+...
Java
["3\n4\n1 2 3 4\n1 2 3 4\n4\n11 12 20 21\n44 22 11 30\n1\n1000000000\n1000000000"]
1 second
["0001\n1111\n1"]
NoteIn the first test case, the $$$4$$$-th player will beat any other player on any game, so he will definitely win the tournament.In the second test case, everyone can be a winner. In the third test case, there is only one player. Clearly, he will win the tournament.
Java 8
standard input
[ "data structures", "dfs and similar", "dp", "graphs", "greedy", "two pointers" ]
f9cf1a6971a7003078b63195198e5a51
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of test cases. The description of test cases follows. The first line of each test case contains a single integer $$$n$$$ ($$$1 \leq n \leq 10^5$$$) — the number of players. The second line of each test case contains $$$n$$$ integers $...
1,700
For each test case print a string of length $$$n$$$. $$$i$$$-th character should be "1" if the $$$i$$$-th player can win the tournament, or "0" otherwise.
standard output