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
6703f97031ac58f15cfb8c43d7c32104
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int t = cin.nextInt(); for (int i = 0; i < t; i++) { int n = cin.nextInt(); System.out.println(new Solution().func(n, cin.next())); ...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 8
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
0470c55b8e9d8695121e10dfd4a3ebd2
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.util.Map.*; import static java.util.Arrays.*; import static java.util.Collections.*; import static java.lang.System.*; public class Main { public void tq() throws Exception { st=new StringTokenizer(bq.rea...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 8
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
74fd3f02d7ccd43f23e2ccbb6ea116cd
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
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\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 8
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
6e1825529e74f489cb64c1d30104adc3
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class E123E { static StringBuffer ans1 = new StringBuffer(""); static FastScanner sc = new FastScanner(); static PrintWriter printWriter = new Print...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
3266c25a4b94fc70622689f39b07fcf6
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.util.*; import java.io.*; public class Main{ static final int mod=998244353; static final int maxn=3000+10; static IO io; static Integer n,m; public static void main(String[] args)throws IOException { io=new IO(); int t; t=io.nextInt(); //t=1; while(t>0) { t--; solve(...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
d33bc54597d2a995a116628957a757e8
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.*; public class Main { 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))); in...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
19ec580f255be8ebfa3269dd00bb8d0e
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.StringTokenizer; public class App { static class FastReader ...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
9e434cba2fdb2f7424c282ca193e01af
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Scanner scn = new Scanner(System.in); OutputWriter out = new OutputWriter(System.out); // Always print a trailing "\n" and close the OutputWriter as shown at th...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
047872643f053cdbc91cd5b3bca85ed9
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.*; public class Path { public static void main(String[] args) throws Exception { FastIO in = new FastIO(); int t = in.nextInt(); for (int tc=0; tc<t; tc++) { long n = in.nextLong(); String s = in.next(); int rCount = 0; int dCount = 0; for (int i=0; i<...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
75a5ef4f9409f46ef0bf0546833db598
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.util.*; import java.io.*; public class _1644_E { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(System.out); int t = Integer.parseInt(in.readLine()); ...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
3d2225083c02cbac51df04f3df897849
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class E{ static class pt{ public int x, y; public pt(int a, int b) { x=a;y=b; } } public static void main(String[] args) throws IOException { // br = new BufferedReader(new FileReader(".in")); // out = new Prin...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
ba38f4bc7e0e5df5a1114c140a4ef6f3
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.math.RoundingMode; import java.util.*; public class Main { static final long MOD1=1000000007; static final long MOD=998244353; static final int NTT...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
896e1eabe81a1e8c0e42732dfd248b45
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.util.*; import java.io.*; import java.util.HashMap; import java.util.function.Consumer; import java.util.Comparator; public class FirstProject{ public static void main(String[] args) throws IOException{ BufferedReader in=new BufferedReader(new InputStreamReader(System.in)); PrintWriter o...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
e66f9b26d8dcfd279d69570c098bc226
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
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\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
f7877677780b0e5c489b890632902cf5
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.Random; import java.util.StringTokenizer; public class codeforces_Edu123_E { private static void solve(FastIOAdapter in, PrintWriter out) { int n = in.nextInt(); char[] s = in.next().toCharArray(); int x = 1, y = 1; ...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
ed1b7c00088f732031545fc9bf6113cc
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
//package expandthepath; import java.util.*; import java.io.*; public class expandthepath { public static void main(String[] args) throws IOException { BufferedReader fin = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(fin.readLine()); StringBuilder fout = new StringBu...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
8075625e4149364db8fcc5929fcd1e3f
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class Eshan { static BufferedReader br = new BufferedReader(new InputStrea...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
5a3d002a10d16fa01515e8eda18507f0
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
// JAI SHREE RAM, HAR HAR MAHADEV, HARE KRISHNA import java.util.*; import java.util.Map.Entry; import java.util.stream.*; import java.lang.*; import java.math.BigInteger; import java.text.DecimalFormat; import java.io.*; public class Eshan { static BufferedReader br = new BufferedReader(new InputStrea...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
8f7f73ab2a597ab5d8ce9a28fe35dce3
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
/* "Everything in the universe is balanced. Every disappointment you face in life will be balanced by something good for you! Keep going, never give up." Just have Patience + 1... */ import java.util.*; import java.lang.*; impor...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
0b8eb6861483dfe48222491dc02002e2
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.*; public class new1{ static long mod = 1000000007; public static long gcd(long a, long b) { if (a == 0) return b; return gcd(b%a, a); } public static void main(String[] args) throws IOException{ BufferedWriter output = new B...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
0197c975161a56d787c0a0f8c41e4033
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.*; public class Main { static class Scanner { Scanner(InputStream in) { this.in = in; } InputStream in; byte[] bb = new byte[1 << 15]; int i, n; byte getc() { if (i == n) { i = n = 0; try { n = in.read(bb); } catch (IOException e) {} } return i < n...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
e0bb1d992ef3558853c83672cb7edcfc
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class E { private static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); private static BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(System.out)); private static StringTokenizer st; pu...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
e27137f9175ace016e3c78a835e4e4d0
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.lang.reflect.Array; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String[] args){ InputStream input...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
8cb7ff973bad69e1d2216f4f1d305482
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.Arrays; import java.util.Random; import java.io.FileWriter; import java.io.PrintWriter; /* Solution Created: 18:14:45 22/02/2022 C...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
ab900168c914f8df4d363ba24fb8d391
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.util.*;import java.io.*;import java.math.*; public class Main{ public static void process(int t)throws IOException { int n = ni(); String s = nln(); int x = 1, y = 1; for(int i=0;i<s.length();i++){ if(s.charAt(i) == 'R') x++; else y+...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
d43dbb0d549910e7637ea678eae63df2
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class E { public static FastScanner s = new FastScanner(); public static PrintWriter out = new PrintWriter(System.out); public sta...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 11
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
6aeb715ac4a5a23da42c36efe673705a
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.io.*; import java.text.MessageFormat; import java.util.Arrays; import java.util.InputMismatchException; /** * Provide prove of correctness before implementation. Implementation can cost a lot of time. * Anti test that prove that it's wrong. * <p> * Do not confuse i j k g indexes, upTo and leng...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 17
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
837a3c25100fb0b75ad40d65e7c0b1d9
train_108.jsonl
1645540500
Consider a grid of size $$$n \times n$$$. The rows are numbered top to bottom from $$$1$$$ to $$$n$$$, the columns are numbered left to right from $$$1$$$ to $$$n$$$.The robot is positioned in a cell $$$(1, 1)$$$. It can perform two types of moves: D — move one cell down; R — move one cell right. The robot is not all...
256 megabytes
import java.util.*; import java.util.function.*; import java.io.*; // you can compare with output.txt and expected out public class RoundEdu123E { MyPrintWriter out; MyScanner in; // final static long FIXED_RANDOM; // static { // FIXED_RANDOM = System.currentTimeMillis(); // } final static String I...
Java
["3\n\n4\n\nRD\n\n5\n\nDRDRDRDR\n\n3\n\nD"]
2 seconds
["13\n9\n3"]
NoteIn the first testcase, it's enough to consider the following modified paths: RD $$$\rightarrow$$$ RRD $$$\rightarrow$$$ RRRD $$$\rightarrow$$$ RRRDD $$$\rightarrow$$$ RRRDDD — this path visits cells $$$(1, 1)$$$, $$$(1, 2)$$$, $$$(1, 3)$$$, $$$(1, 4)$$$, $$$(2, 4)$$$, $$$(3, 4)$$$ and $$$(4, 4)$$$; RD $$$\righta...
Java 17
standard input
[ "brute force", "combinatorics", "data structures", "implementation", "math" ]
113a43af2f1c5303f83eb842ef532040
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of testcases. The first line of each testcase contains the single integer $$$n$$$ ($$$2 \le n \le 10^8$$$) — the number of rows and columns in the grid. The second line of each testcase contains a non-empty string $$$s$$$, consisting...
1,900
For each testcase, print a single integer — the number of cells such that there exists at least one sequence of modifications that the robot visits this cell on the modified path and doesn't move outside the grid.
standard output
PASSED
2ec8aae573fe98b4ac625a8fe58fce26
train_108.jsonl
1658673300
You are given a positive integer $$$n$$$. Since $$$n$$$ may be very large, you are given its binary representation.You should compute the number of triples $$$(a,b,c)$$$ with $$$0 \leq a,b,c \leq n$$$ such that $$$a \oplus b$$$, $$$b \oplus c$$$, and $$$a \oplus c$$$ are the sides of a non-degenerate triangle. Here, $$...
512 megabytes
import java.io.*; import java.util.*; public class a{ public static FastScanner fs; public static long mod=998244353l; public static void main(String args[]) { fs=new FastScanner(); char s[]=fs.next().toCharArray(); int condition[]=new int[8]; Arrays.fill(condit...
Java
["101", "1110", "11011111101010010"]
4 seconds
["12", "780", "141427753"]
NoteIn the first test case, $$$101_2=5$$$. The triple $$$(a, b, c) = (0, 3, 5)$$$ is valid because $$$(a\oplus b, b\oplus c, c\oplus a) = (3, 6, 5)$$$ are the sides of a non-degenerate triangle. The triple $$$(a, b, c) = (1, 2, 4)$$$ is valid because $$$(a\oplus b, b\oplus c, c\oplus a) = (3, 6, 5)$$$ are the sides o...
Java 11
standard input
[ "bitmasks", "brute force", "constructive algorithms", "dp", "greedy", "math" ]
94bc4b263821713fb5b1de4de331a515
The first and only line contains the binary representation of an integer $$$n$$$ ($$$0 &lt; n &lt; 2^{200\,000}$$$) without leading zeros. For example, the string 10 is the binary representation of the number $$$2$$$, while the string 1010 represents the number $$$10$$$.
2,500
Print one integer — the number of triples $$$(a,b,c)$$$ satisfying the conditions described in the statement modulo $$$998\,244\,353$$$.
standard output
PASSED
a2d8662b4345a4c8d254f444c16157eb
train_108.jsonl
1658673300
You are given a positive integer $$$n$$$. Since $$$n$$$ may be very large, you are given its binary representation.You should compute the number of triples $$$(a,b,c)$$$ with $$$0 \leq a,b,c \leq n$$$ such that $$$a \oplus b$$$, $$$b \oplus c$$$, and $$$a \oplus c$$$ are the sides of a non-degenerate triangle. Here, $$...
512 megabytes
import java.io.*; import java.util.*; public class Div1COPY { static long MOD = 998244353; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter...
Java
["101", "1110", "11011111101010010"]
4 seconds
["12", "780", "141427753"]
NoteIn the first test case, $$$101_2=5$$$. The triple $$$(a, b, c) = (0, 3, 5)$$$ is valid because $$$(a\oplus b, b\oplus c, c\oplus a) = (3, 6, 5)$$$ are the sides of a non-degenerate triangle. The triple $$$(a, b, c) = (1, 2, 4)$$$ is valid because $$$(a\oplus b, b\oplus c, c\oplus a) = (3, 6, 5)$$$ are the sides o...
Java 11
standard input
[ "bitmasks", "brute force", "constructive algorithms", "dp", "greedy", "math" ]
94bc4b263821713fb5b1de4de331a515
The first and only line contains the binary representation of an integer $$$n$$$ ($$$0 &lt; n &lt; 2^{200\,000}$$$) without leading zeros. For example, the string 10 is the binary representation of the number $$$2$$$, while the string 1010 represents the number $$$10$$$.
2,500
Print one integer — the number of triples $$$(a,b,c)$$$ satisfying the conditions described in the statement modulo $$$998\,244\,353$$$.
standard output
PASSED
30093d45c12daaf29406c6264807ac1f
train_108.jsonl
1658673300
You are given a positive integer $$$n$$$. Since $$$n$$$ may be very large, you are given its binary representation.You should compute the number of triples $$$(a,b,c)$$$ with $$$0 \leq a,b,c \leq n$$$ such that $$$a \oplus b$$$, $$$b \oplus c$$$, and $$$a \oplus c$$$ are the sides of a non-degenerate triangle. Here, $$...
512 megabytes
import java.io.*; import java.util.*; public class a{ public static FastScanner fs; public static long mod=998244353l; public static void main(String args[]) { fs=new FastScanner(); char s[]=fs.next().toCharArray(); int condition[]=new int[8]; Arrays.fill(condit...
Java
["101", "1110", "11011111101010010"]
4 seconds
["12", "780", "141427753"]
NoteIn the first test case, $$$101_2=5$$$. The triple $$$(a, b, c) = (0, 3, 5)$$$ is valid because $$$(a\oplus b, b\oplus c, c\oplus a) = (3, 6, 5)$$$ are the sides of a non-degenerate triangle. The triple $$$(a, b, c) = (1, 2, 4)$$$ is valid because $$$(a\oplus b, b\oplus c, c\oplus a) = (3, 6, 5)$$$ are the sides o...
Java 11
standard input
[ "bitmasks", "brute force", "constructive algorithms", "dp", "greedy", "math" ]
94bc4b263821713fb5b1de4de331a515
The first and only line contains the binary representation of an integer $$$n$$$ ($$$0 &lt; n &lt; 2^{200\,000}$$$) without leading zeros. For example, the string 10 is the binary representation of the number $$$2$$$, while the string 1010 represents the number $$$10$$$.
2,500
Print one integer — the number of triples $$$(a,b,c)$$$ satisfying the conditions described in the statement modulo $$$998\,244\,353$$$.
standard output
PASSED
ef732fe8a0c3ac2b602f001bf0f1276b
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class Q1710A { static int mod = (int) (1e9 + 7); public static long[] sortLong(long[] a2) { ArrayList<Long> l = new ArrayList<>(); for (long i : a2) l.add(i); Collections.sort(l); for (int i = 0; i < l.size(); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
85fddcf51cbb36445559cbf2f78c886a
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.io.*; public class A1710{ static FastScanner fs = null; public static void main(String[] args) { fs = new FastScanner(); PrintWriter out = new PrintWriter(System.out); int t = fs.nextInt(); while(t-->0){ int n = fs.nextInt(); int m = fs.nextInt(); int k = fs...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
99af16da60e20f29b97da136c06a0477
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
/** * @author 86152 * Color the Picture */ import java.io.*; import java.util.*; import java.util.function.IntUnaryOperator; import java.util.function.LongUnaryOperator; import java.util.stream.Collectors; public class CF1710 { static In in = new FastIn(); static Out out = new Out(false); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
00a9d3b06f454f8963f1a1f22679f34a
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
/** * @author 86152 * Color the Picture */ import java.io.*; import java.util.*; import java.util.function.IntUnaryOperator; import java.util.function.LongUnaryOperator; import java.util.stream.Collectors; public class CF1710 { static In in = new FastIn(); static Out out = new Out(false); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
8aa6e01216e6dbcdeb78d2e834f5993f
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
/** * @author 86152 * Color the Picture */ import java.io.*; import java.util.*; import java.util.function.IntUnaryOperator; import java.util.function.LongUnaryOperator; import java.util.stream.Collectors; public class CF1710 { static In in = new FastIn(); static Out out = new Out(false); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
4b9da9efb1ba67dfd376ba70d0008c3f
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
/** * @author 86152 * Color the Picture */ import java.io.*; import java.util.*; import java.util.function.IntUnaryOperator; import java.util.function.LongUnaryOperator; import java.util.stream.Collectors; public class Main { static In in = new FastIn(); static Out out = new Out(false); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
4890650cc20be16798878db9c899b4ab
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class Main { static PrintWriter out; static Kioken sc; static boolean checkOnlineJudge = System.getProperty("ONLINE_JUDGE") == null; public static void main(String[] args) throws FileNotFoundException { boolean t = true; boolean f ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
21dfa13d5af6b086944f14401556bb9b
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.lang.*; import java.util.*; public class ComdeFormces { static pair dp[][]; static boolean mnans; public static void main(String[] args) throws Exception{ // TODO Auto-generated method stub // Reader.init(System.in); FastReader sc=new FastReader(); BufferedWriter log =...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
f537eb8dc1812e749be81ff15b5d1c16
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.lang.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class C810 { public static int n; static BufferedReader inp = new BufferedReader(new InputStreamReader(System.in)); public static void make(int n) throws IO...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
296dc00b05ade20dfa1387efc4646f03
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { static long mod = (int)1e9+7; static PrintWriter out=new PrintWriter(new BufferedOutputStream(System.out)); public static void main (String[] args) throws java.lang.Exception { FastReader sc =new FastReader(...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
fb4db8a3efc00db9cbf592189378652a
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; public class Solution { boolean isPossible(long main,long sec,long A[]) { long total=0,count=0; for(int i=0;i<A.length;i++) { long num=A[i]/sec; if(num>1) { if(num>2) count++; ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
39501635fc12b43a264800356d817ac5
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashSet; import java.util.Random; import java.util.StringTokenizer; /* 1 3 3 2 8 8 ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
3973343d0cf35c2b26f776a63868174e
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Arrays; import java.util.*; import java.util.Scanner; import java.util.StringTokenizer; public class copy { static int log=30; ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
b957aac0015e056455b7d62d27971105
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; /** * * @author xpeng */ public class codeforces { public static boolean test(int row,int col,int[] arr){ long sum=0; for (int i = 0; i < arr.length; i++) { if (Math.fl...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
f02e719f336e3fdcee4e9b7e3af36e9a
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
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 Main { //------------------------------------------------input class---------------------------------------// ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
2b9bc8ea3f5db65e97f60960256f7444
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { static final PrintWriter out =new PrintWriter(System.out); static final FastReader sc = new FastReader(); //I invented a new word!Plagiarism! //Did you hear about the mathematician who’s afraid of negative numbers?He’l...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
194adea074c738ce87c6bc46d8405dc1
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
/* Rating: 1378 Date: 12-08-2022 Time: 23-18-31 Author: Kartik Papney Linkedin: https://www.linkedin.com/in/kartik-papney-4951161a6/ Leetcode: https://leetcode.com/kartikpapney/ Codechef: https://www.codechef.com/users/kartikpapney ----------------------------Jai Shree Ram---------...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
84d17c74acc4743173dfc61b15648604
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.lang.Math; import java.util.*; import javax.management.ValueExp; public final class Codechef { static BufferedReader br = new BufferedReader( new InputStreamReader(System.in) ); static BufferedWriter bw = new BufferedWriter( new OutputStreamWriter(System.out) ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
eb98c32675dd52bd6cfa0f0b2b326db5
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class ColorthePicture { static int MAXN = 1123456; static boolean[] prime = new boolean[MAXN]; static boolean[] used = new boolean[MAXN]; public static void seive() { for (int i = 2; i <...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
6d4f5a39f3cae8b69b71d3cc593db334
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
public class A { public Object solve () { int R = sc.nextInt(), C = sc.nextInt(); sc.nextInt(); long [] A = sc.nextLongs(); if (calc(R, C, A.clone())) return "Yes"; if (calc(C, R, A.clone())) return "Yes"; return "No"; } boolean calc (int R, int C, long [] A) { int N = A.len...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
29c2b5b0c29261bf8b1fd6eb6be33497
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
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 A_Color_the_Picture { static long mod = Long.MAX_VALUE; public static void main(String[] args) { OutputStream outp...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
502c46bc03d407494f87dc568cffb99e
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.text.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { FastReader sc = new FastReader(); PrintWriter writer = new PrintWriter(System.out); int t = sc.nextInt(); while(t-->0) {...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
04dd454f77f61be59b4904ff7b113a15
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static int INF = 0x3f3f3f3f; public static int mod = 1000000007; public static int mod9 = 998244353; public static void main(String args[]){ try { PrintWriter o = new PrintWriter(System.out); bool...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
369127f171bb02033d26767a3b550633
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; // import static java.lang.Math.*; public class Round810_Div1_A implements Runnable { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); public...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
4bf4119d6e96861078bb61cd57a1a4ff
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class cd810div1A { public static void main(String[] args) { Scanner in = new Scanner(System.in); int tt = in.nextInt(); for(int w=0; w<tt; w++) { int n=in.nextInt(); int m=in.nextInt(); int k =in.ne...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
fe8a460be853a8d66c65de83e150a5fa
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.StringTokenizer; public class A { static FastScanner in; static PrintWriter out; public static void main(String[] args) { in = new FastScanner(System.in); out = new PrintWriter(System.out); int T = in.nextInt(); for (int t = 0; ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
8fcf821e4d20a7d8bb3019760ca78509
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { //BufferedReader f = new BufferedReader(new FileReader("uva.in")); //PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter("milkvisits.out"))); Buffered...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
08b203936648c411166ebc0ed78e7e9a
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class A { static IOHandler sc = new IOHandler(); public static void main(String[] args) { // TODO Auto-generated method stub int testCases = sc.nextInt(); for (int i = 1; i <= testCases; ++i) { solve(i); } } private static void solve(i...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 11
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
646edfe545d5dbafcd293c7b1dff15f5
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
// When I wrote this code, only God & I knew what it did. Now only God knows !! import java.util.*; import java.io.*; public class Main { static class FastReader { private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public FastReader() { this(System.in); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
48f68e60e75a6faa9f27f3e65e198537
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. ***********************************************...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
30814b47bb439c9cfd5f6f101e5e6c1a
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.util.Map.Entry; import java.io.*; import java.lang.*; public class main1{ FastScanner in; PrintWriter out; public static void main(String[] arg) { new main1().run(); } //////////////SOLVE QUESTIONS HERE//////////...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
901a783bcf230dea394bc1cff8135ce9
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; public class color { public static boolean solve(long sum,int n,int m,int flag){ if (m%2==0){ return (sum>=m); } else{ return (sum>=m && flag==1); } } public static void main(String[] args){ Scanner sc=new ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
f477aa313496ff001dd461e48c0e159d
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; public class ColorThePicture { public static void solve(Scanner sc) { long n = sc.nextLong(); long m = sc.nextLong(); int k = sc.nextInt(); long[] c = new long[k]; long sum = 0; long cols = 0; long rows = 0; long colodd = 0; long colmax = 0; long rowodd = 0; long rowmax =...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
e1e8a75934703f600196eeb646937380
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; public class Test1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); while(tc-->0) { int row = sc.nextInt(), col = sc.nextInt(), k = sc.nextInt(); int[] arr = new int[k]; for(int i=0;i<k;i++) ar...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
e05a4fda235842bb587ca2541e77bab8
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; public class color { public static boolean solve(long sum,int n,int m,int flag){ if (m%2==0){ return (sum>=m); } else{ return (sum>=m && flag==1); } } public static void main(String[] args){ Scanner sc=n...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
6844d3a80096114d7f5d75d75552e87c
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; public class Sol { public static void main(String[] args) { Scanner read = new Scanner(System.in); int tt = read.nextInt(); while(tt-- > 0){ long n = read.nextLong(); long m = read.nextLong(); long k = read.nextLong(); int f = 0, f1 = 0; int a[] = new int[(int) (...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 17
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
08fcc8cb1ca65c4f547fd5f950a341c9
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.Scanner; public class A1710 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for (int t=0; t<T; t++) { int N = in.nextInt(); int M = in.nextInt(); int K = in.nextInt(); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
c18bafb91dc9f6a4b0f6b240f62c003d
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
//---#ON_MY_WAY--- //---#THE_SILENT_ONE--- import static java.lang.Math.*; import java.io.*; import java.math.*; import java.util.*; public class apples { static FastReader x = new FastReader(); static OutputStream outputStream = System.out; static PrintWriter out = new PrintWriter(outputStream); /*...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
f8c4e9d7afb46b849f61406e765d143b
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
//---#ON_MY_WAY--- //---#THE_SILENT_ONE--- import static java.lang.Math.*; import java.io.*; import java.math.*; import java.util.*; public class apples { static FastReader x = new FastReader(); static OutputStream outputStream = System.out; static PrintWriter out = new PrintWriter(outputStream); /*...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
1ca3de9e30a2544bb7dffd0a5e38155d
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.Arrays; import java.util.Collections; import java.util.Scanner; public class cd810div1A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); for (int j = 0; j < tc; j++) { int n = sc.nextInt(); int m = sc.nextInt(); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
d7e72c3d5fa6dcf434f8eb6de2421954
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); public static void main(String[] args){ MyScanner scanner = new MyScanner(); int numOfTests = scanner.nextInt(); for(int t = 1; t ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
d4ca4074ea37129fd9e77f77a7520ece
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
// Problem: A. Color the Picture // Contest: Codeforces - Codeforces Round #810 (Div. 1) // URL: https://codeforces.com/problemset/problem/1710/A // Memory Limit: 256 MB // Time Limit: 1000 ms import java.util.*; import java.io.*; public class Main { static FastReader sc=new FastReader(); static Pr...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
7ebbe9006fba1bb91239d126a3f0e449
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; import java.util.function.DoubleToLongFunction; public class Codeforces810{ static long mod = 1000000007L; static MyScanner sc = new MyScanner(); static void solve() { int n = sc.nextInt(); if(n==1){ out.println(1); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
664582debdd2463854f71daa66ec981a
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public final class Main { //int 2e9 - long 9e18 static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(0, 1), new Pair(1, 0), new Pair(0, -1)}; static...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
527861416f5b65bdd65ec0963c3bb5a3
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class TaskB { BufferedReader br; StringTokenizer in; PrintWriter out; public String nextToken() throws IOException { while (in == null || !in.hasMoreTokens()) { in = new StringTokenizer(br.readLine()); } retur...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
56df726c677932c77601e1bf15cc07bf
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; public class p1 { BufferedReader br; StringTokenizer st; BufferedWriter bw; public static void main(String[] args)throws Exception { new p1().run(); } void run()throws IOException { br = new BufferedReader(new InputStreamReader(System.in)); bw=new Bu...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
ebd67903c8dcaf403af3fa8e5369f022
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; /** * @author KaiXin * @version 11 * @date 2022-07-12 13:03 */ public class TaskA { static final int SIZE = (int)2e5 + 5; static int[] a = new int[SIZE]; static int[] b = new int[SIZE...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
16df7edd9a9ff40d87d302a1eeddb464
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.io.*; public class Color_The_Picture { public static void main(String[]args){ Kattio io = new Kattio(); int t = io.nextInt(); for(int I = 0; I < t; I++) { int n = io.nextInt(); int m = io.nextInt(); int k = io.nextInt(); int mval = 0; int maxmval = 0; int nval = ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
87fc4cad3659b5ddaf178c15e9b4fc8b
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.HashSet; import java.util.Set; public class ColorThePicture { public static void main(String[] args) throws IOException { BufferedReader br=new BufferedReader...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
cb80ad6c8764fc6ea4d70e091be626ec
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
// package faltu; import java.util.*; import java.util.Map.Entry; import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWrit...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
486cbdb1ccef048af88d52e927ce04c5
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static int n,m,k; public static int [] a; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0){ n = sc.nextInt(); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
7ea5c13ca3b0cc92ae55aa5b6000e9b8
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; /* * Author: Atuer */ public class Main { // ==== Solve Code ====// static int INF = 2000000010; public static void csh() { } public static void main(String[] args) throws IOException { // csh(); int t = in.nextInt(); while (t-- > 0) { ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
c1281f549a6fc21785970039ed46d0d5
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Main { static long INF = 2000000000000000010l; static int fx[][] = {{-1,0},{0,1},{1,0},{0,-1},{-1,-1},{1,1},{1,-1},{-1,1}}; public static void main(String[] args) throws IOException { int t=1; t = cin.nextInt(); while (t-- > 0) { //...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
280b2d552437555e6149680a915ba323
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.Scanner; public class A1710 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for (int t=0; t<T; t++) { int N = in.nextInt(); int M = in.nextInt(); int K = in.nextInt(); ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
7be77ef1dcf053ece97cf0bef542ce39
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.BufferedReader; import java.io.Closeable; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.time.Clock; import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; imp...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
fadc34ac63da35d0273ee91b187d70e7
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.io.*; public class ColorThePicture { public static void main(String[] args) throws IOException { Reader in = new Reader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for (int t = 0; t < T; t++) { ...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
e485b666ba2c161dc147247dd2e2fc78
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Bit...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
29b38cef68f9d9421beacc92ab4e1c89
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import javax.swing.*; import java.math.BigInteger; import java.util.*; import java.io.*; public class Vaibhav { /*-----------==============---------------------------------------------------------------------------------------------------------------------------------------------------------------------...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
0d25fdd057656a068670e74f4d783e24
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.OutputStream; import java.io.Writer; import java.io.IOException; import java.util.InputMismatchException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputS...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
4b9a9f337f2f85748e46c89d58956895
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.*; import java.util.*; // import static java.lang.Math.*; public class Round810_Div1_A implements Runnable { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); public static voi...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
bdd2c7ef303452302e03f417147bbc64
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.Scanner; public class C { public static void main(String[] args) { int casenum = 1; Scanner in = new Scanner(System.in); casenum = in.nextInt(); for (int i = 1; i <= casenum; i++) { work(in); } } static final int MAXN = 100...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
67bffc029954cc8ce686e2b560e2e493
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.util.*; import java.io.*; public class codeforces1710A { public static void main(String[] args) throws IOException { FastReader in = new FastReader(); int numCases = in.nextInt(); while (numCases-->0) { long n = in.nextLong(); long m = i...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
c35803ef3ab502993d564da1eea828e1
train_108.jsonl
1658673300
A picture can be represented as an $$$n\times m$$$ grid ($$$n$$$ rows and $$$m$$$ columns) so that each of the $$$n \cdot m$$$ cells is colored with one color. You have $$$k$$$ pigments of different colors. You have a limited amount of each pigment, more precisely you can color at most $$$a_i$$$ cells with the $$$i$$$-...
256 megabytes
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.Locale; import java.util.StringTokenizer; public class Solution imple...
Java
["6\n\n4 6 3\n\n12 9 8\n\n3 3 2\n\n8 8\n\n3 3 2\n\n9 5\n\n4 5 2\n\n10 11\n\n5 4 2\n\n9 11\n\n10 10 3\n\n11 45 14"]
1 second
["Yes\nNo\nYes\nYes\nNo\nNo"]
NoteIn the first test case, one possible solution is as follows: In the third test case, we can color all cells with pigment $$$1$$$.
Java 8
standard input
[ "constructive algorithms", "greedy", "math" ]
002129eec704af8976a2bf02cc532d59
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains three integers $$$n$$$, $$$m$$$, and $$$k$$$ ($$$3 \leq n,m \leq 10^9$$$, $$$1 \leq k \leq 10^5$$$) — the numb...
1,500
For each test case, print "Yes" (without quotes) if it is possible to color a beautiful picture. Otherwise, print "No" (without quotes).
standard output
PASSED
6b94187a8f41bba4b5de071cc7410f76
train_108.jsonl
1658673300
You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers.It will rain for the next $$$n$$$ days. On the $$$i$$$-th day, the rain will be centered at position $$$x_i$$$ and it will have intensity $$$p_i$$$. Due to these rains, some rainfall will accumul...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static Solution2 admin = new Solution2(); public static void main(String[] args) { admin.start(); } } class Solution2 { //---------------------------------INPUT READER-----------------------------------------// pub...
Java
["4\n\n3 6\n\n1 5\n\n5 5\n\n3 4\n\n2 3\n\n1 3\n\n5 2\n\n2 5\n\n1 6\n\n10 6\n\n6 12\n\n4 5\n\n1 6\n\n12 5\n\n5 5\n\n9 7\n\n8 3"]
4 seconds
["001\n11\n00\n100110"]
NoteIn the first test case, if we do not use the spell, the accumulated rainfall distribution will be like this: If we erase the third day's rain, the flood is avoided and the accumulated rainfall distribution looks like this: In the second test case, since initially the flood will not happen, we can erase any day's ...
Java 8
standard input
[ "binary search", "brute force", "data structures", "geometry", "greedy", "implementation", "math" ]
268cf03c271d691c3c1e3922e884753e
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$, $$$1 \leq m \leq 10^9$$$) — the number of ...
2,100
For each test case, output a binary string $$$s$$$ length of $$$n$$$. The $$$i$$$-th character of $$$s$$$ is 1 if after erasing the $$$i$$$-th day's rain there is no flood, while it is 0, if after erasing the $$$i$$$-th day's rain the flood still happens.
standard output
PASSED
87f25e6d8330fec08250944176e3a893
train_108.jsonl
1658673300
You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers.It will rain for the next $$$n$$$ days. On the $$$i$$$-th day, the rain will be centered at position $$$x_i$$$ and it will have intensity $$$p_i$$$. Due to these rains, some rainfall will accumul...
256 megabytes
import java.io.*; import java.util.*; public class Solution { static Solution2 admin = new Solution2(); public static void main(String[] args) { admin.start(); } } class Solution2 { //---------------------------------INPUT READER-----------------------------------------// pub...
Java
["4\n\n3 6\n\n1 5\n\n5 5\n\n3 4\n\n2 3\n\n1 3\n\n5 2\n\n2 5\n\n1 6\n\n10 6\n\n6 12\n\n4 5\n\n1 6\n\n12 5\n\n5 5\n\n9 7\n\n8 3"]
4 seconds
["001\n11\n00\n100110"]
NoteIn the first test case, if we do not use the spell, the accumulated rainfall distribution will be like this: If we erase the third day's rain, the flood is avoided and the accumulated rainfall distribution looks like this: In the second test case, since initially the flood will not happen, we can erase any day's ...
Java 8
standard input
[ "binary search", "brute force", "data structures", "geometry", "greedy", "implementation", "math" ]
268cf03c271d691c3c1e3922e884753e
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$, $$$1 \leq m \leq 10^9$$$) — the number of ...
2,100
For each test case, output a binary string $$$s$$$ length of $$$n$$$. The $$$i$$$-th character of $$$s$$$ is 1 if after erasing the $$$i$$$-th day's rain there is no flood, while it is 0, if after erasing the $$$i$$$-th day's rain the flood still happens.
standard output
PASSED
db048384d261c1ba2088bcbb23e7d245
train_108.jsonl
1658673300
You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers.It will rain for the next $$$n$$$ days. On the $$$i$$$-th day, the rain will be centered at position $$$x_i$$$ and it will have intensity $$$p_i$$$. Due to these rains, some rainfall will accumul...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String args[]) {new Main().run();} FastReader in = new FastReader(); PrintWriter out = new PrintWriter(System.out); void run() { for(int q=ni();q>0;q--){ work(); } out.flus...
Java
["4\n\n3 6\n\n1 5\n\n5 5\n\n3 4\n\n2 3\n\n1 3\n\n5 2\n\n2 5\n\n1 6\n\n10 6\n\n6 12\n\n4 5\n\n1 6\n\n12 5\n\n5 5\n\n9 7\n\n8 3"]
4 seconds
["001\n11\n00\n100110"]
NoteIn the first test case, if we do not use the spell, the accumulated rainfall distribution will be like this: If we erase the third day's rain, the flood is avoided and the accumulated rainfall distribution looks like this: In the second test case, since initially the flood will not happen, we can erase any day's ...
Java 8
standard input
[ "binary search", "brute force", "data structures", "geometry", "greedy", "implementation", "math" ]
268cf03c271d691c3c1e3922e884753e
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$, $$$1 \leq m \leq 10^9$$$) — the number of ...
2,100
For each test case, output a binary string $$$s$$$ length of $$$n$$$. The $$$i$$$-th character of $$$s$$$ is 1 if after erasing the $$$i$$$-th day's rain there is no flood, while it is 0, if after erasing the $$$i$$$-th day's rain the flood still happens.
standard output
PASSED
a0f87f3c6b3d47918cbceaf8351a8a62
train_108.jsonl
1658673300
You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers.It will rain for the next $$$n$$$ days. On the $$$i$$$-th day, the rain will be centered at position $$$x_i$$$ and it will have intensity $$$p_i$$$. Due to these rains, some rainfall will accumul...
256 megabytes
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintStream; import java.util.Locale; import java.util.StringTokenizer; import java.util.TreeMap; im...
Java
["4\n\n3 6\n\n1 5\n\n5 5\n\n3 4\n\n2 3\n\n1 3\n\n5 2\n\n2 5\n\n1 6\n\n10 6\n\n6 12\n\n4 5\n\n1 6\n\n12 5\n\n5 5\n\n9 7\n\n8 3"]
4 seconds
["001\n11\n00\n100110"]
NoteIn the first test case, if we do not use the spell, the accumulated rainfall distribution will be like this: If we erase the third day's rain, the flood is avoided and the accumulated rainfall distribution looks like this: In the second test case, since initially the flood will not happen, we can erase any day's ...
Java 8
standard input
[ "binary search", "brute force", "data structures", "geometry", "greedy", "implementation", "math" ]
268cf03c271d691c3c1e3922e884753e
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$, $$$1 \leq m \leq 10^9$$$) — the number of ...
2,100
For each test case, output a binary string $$$s$$$ length of $$$n$$$. The $$$i$$$-th character of $$$s$$$ is 1 if after erasing the $$$i$$$-th day's rain there is no flood, while it is 0, if after erasing the $$$i$$$-th day's rain the flood still happens.
standard output
PASSED
e90b286b3d48413e3be81a9b1aa714c5
train_108.jsonl
1658673300
You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers.It will rain for the next $$$n$$$ days. On the $$$i$$$-th day, the rain will be centered at position $$$x_i$$$ and it will have intensity $$$p_i$$$. Due to these rains, some rainfall will accumul...
256 megabytes
import java.util.*; import java.io.*; public class Rain { public static void main(String[] args) throws IOException { Reader in = new Reader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for (int t = 0; t < T; t++) { int N = in....
Java
["4\n\n3 6\n\n1 5\n\n5 5\n\n3 4\n\n2 3\n\n1 3\n\n5 2\n\n2 5\n\n1 6\n\n10 6\n\n6 12\n\n4 5\n\n1 6\n\n12 5\n\n5 5\n\n9 7\n\n8 3"]
4 seconds
["001\n11\n00\n100110"]
NoteIn the first test case, if we do not use the spell, the accumulated rainfall distribution will be like this: If we erase the third day's rain, the flood is avoided and the accumulated rainfall distribution looks like this: In the second test case, since initially the flood will not happen, we can erase any day's ...
Java 8
standard input
[ "binary search", "brute force", "data structures", "geometry", "greedy", "implementation", "math" ]
268cf03c271d691c3c1e3922e884753e
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$, $$$1 \leq m \leq 10^9$$$) — the number of ...
2,100
For each test case, output a binary string $$$s$$$ length of $$$n$$$. The $$$i$$$-th character of $$$s$$$ is 1 if after erasing the $$$i$$$-th day's rain there is no flood, while it is 0, if after erasing the $$$i$$$-th day's rain the flood still happens.
standard output
PASSED
7b7fa12c8bb14f3846a09cd4d7e308ed
train_108.jsonl
1658673300
You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers.It will rain for the next $$$n$$$ days. On the $$$i$$$-th day, the rain will be centered at position $$$x_i$$$ and it will have intensity $$$p_i$$$. Due to these rains, some rainfall will accumul...
256 megabytes
import static java.lang.Math.*; import static java.util.Arrays.*; import java.util.*; public class B { public Object solve () { int N = sc.nextInt(), M = sc.nextInt(); int [] X = new int [N], P = new int [N]; for (int i : rep(N)) { X[i] = sc.nextInt(); P[i] = sc.nextInt(); } LinkedLi...
Java
["4\n\n3 6\n\n1 5\n\n5 5\n\n3 4\n\n2 3\n\n1 3\n\n5 2\n\n2 5\n\n1 6\n\n10 6\n\n6 12\n\n4 5\n\n1 6\n\n12 5\n\n5 5\n\n9 7\n\n8 3"]
4 seconds
["001\n11\n00\n100110"]
NoteIn the first test case, if we do not use the spell, the accumulated rainfall distribution will be like this: If we erase the third day's rain, the flood is avoided and the accumulated rainfall distribution looks like this: In the second test case, since initially the flood will not happen, we can erase any day's ...
Java 11
standard input
[ "binary search", "brute force", "data structures", "geometry", "greedy", "implementation", "math" ]
268cf03c271d691c3c1e3922e884753e
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \leq t \leq 10^4$$$). The description of the test cases follows. The first line of each test case contains two integers $$$n$$$ and $$$m$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$, $$$1 \leq m \leq 10^9$$$) — the number of ...
2,100
For each test case, output a binary string $$$s$$$ length of $$$n$$$. The $$$i$$$-th character of $$$s$$$ is 1 if after erasing the $$$i$$$-th day's rain there is no flood, while it is 0, if after erasing the $$$i$$$-th day's rain the flood still happens.
standard output