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
8cc7888aa687bfc330a5fc25bd81867f
train_003.jsonl
1402241400
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b...
256 megabytes
import java.util.Scanner; public class TestB { public static void main (String args[]) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); int v=sc.nextInt(); int[] derevja = new int[3010]; int sum_fruktov=0; for (int i=0; i<n; i++){ int k=sc.ne...
Java
["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"]
1 second
["8", "60"]
NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp...
Java 7
standard input
[ "implementation", "greedy" ]
848ead2b878f9fd8547e1d442e2f85ff
The first line contains two space-separated integers n and v (1 ≀ n, v ≀ 3000) β€” the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≀ ai, bi ≀ 30...
1,400
Print a single integer β€” the maximum number of fruit that Valera can collect.
standard output
PASSED
15115fbd0e5c27d2bcd95f5b92ec522d
train_003.jsonl
1402241400
Valera loves his garden, where n fruit trees grow.This year he will enjoy a great harvest! On the i-th tree bi fruit grow, they will ripen on a day number ai. Unfortunately, the fruit on the tree get withered, so they can only be collected on day ai and day ai + 1 (all fruits that are not collected in these two days, b...
256 megabytes
import java.io.BufferedInputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.InputMismatchException; import java.util.Linked...
Java
["2 3\n1 5\n2 3", "5 10\n3 20\n2 20\n1 20\n4 20\n5 20"]
1 second
["8", "60"]
NoteIn the first sample, in order to obtain the optimal answer, you should act as follows. On the first day collect 3 fruits from the 1-st tree. On the second day collect 1 fruit from the 2-nd tree and 2 fruits from the 1-st tree. On the third day collect the remaining fruits from the 2-nd tree. In the second samp...
Java 7
standard input
[ "implementation", "greedy" ]
848ead2b878f9fd8547e1d442e2f85ff
The first line contains two space-separated integers n and v (1 ≀ n, v ≀ 3000) β€” the number of fruit trees in the garden and the number of fruits that Valera can collect in a day. Next n lines contain the description of trees in the garden. The i-th line contains two space-separated integers ai and bi (1 ≀ ai, bi ≀ 30...
1,400
Print a single integer β€” the maximum number of fruit that Valera can collect.
standard output
PASSED
fe5b69b811e7f4385d56a004d1bbc082
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.Scanner; public class B60 { static int[] dx = {0, 0, 0, 0, 1, -1}; static int[] dy = {1, -1, 0, 0, 0, 0}; static int[] dz = {0, 0, 1, -1, 0, 0}; static boolean[][][] vis;//z x y static int k; static int n; static int m; static int counter = 0; public static void dfs(int z, int x, int y) { ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
af78484560cb0d5352c08c0acafeb464
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class B_SerialTime { public static void main(String[] args) { Scanner s = new Scanner(System.in); int k = s.nextInt(), n = s.nextInt(), m = s.nextInt(); boolean b[][][] = new boolean[k][n][m]; for (int t = 0; t < k; ++t) { for (int i = 0; i < n...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
d9a341dab2e2c352e0023b7350805688
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class Serial { static int[] dx = {1, 0, 0, -1, 0, 0}; static int[] dy = {0, -1, 1, 0, 0, 0}; static int[] dz = {0, 0, 0, 0, 1, -1}; static int k, n, m, x, y; public static void main (String args[]) { Scanner sc = new Scanner(System.in); k = sc.nextInt(); ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
0b42e6b3959eb742a8d1ea94ceaab14c
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.Scanner; public class SerialTime { public static void main(String args[]) { // Create a scanner that is to read from System.in Scanner scan = new Scanner(System.in); int layers = scan.nextInt(); int rows = scan.nextInt(); int cols = scan.nextInt(); ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
65f89b90abc62f5cb7954613a4d91d2e
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class Serial { public static void main (String[] args) { Scanner s = new Scanner(System.in); int k, n, m; k = s.nextInt(); n = s.nextInt(); m = s.nextInt(); boolean[][][] dish = new boolean[k+2][n+2][m+2]; // h <- [0.. k+2)...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
df2bfec4ff2843232e9049193a03ecf9
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; import java.io.*; import java.math.BigDecimal; public class Task { public static void main(String[] args) throws Exception { new Task().solve(); } double a; double b; double c; double d; void solve() throws Exception { Reader in = new Reader("1.in"); PrintWriter out = new PrintWr...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
839fb4bfd5536d6873da93b22675fd57
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.DataInputStream; import java.io.InputStream; public class SerialTime { static int ans = 0; static boolean b [][][]; static boolean c [][][]; static int p [][] = {{1,0,0},{-1,0,0},{0,1,0},{0,-1,0},{0,0,1},{0,0,-1}}; public static void main(String [] args) throws Exception{ FS in = new FS(System.i...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
35ea91aaa3194f8ad9c78b16f1656a10
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.LinkedList; import java.util.Scanner; import java.util.Queue; public class Serial { public static void main(String[]args) { Scanner input = new Scanner(System.in); int z = input.nextInt(); int x = input.nextInt(); int y = input.nextInt(); input.nextLine(); char[][][] g = new c...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
bb995192de9aa46ab72e34f231f360ec
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; import java.io.*; public class Main { BufferedReader in; StringTokenizer str = null; PrintWriter out; private String next() throws Exception{ while (str == null || !str.hasMoreElements()) str = new StringTokenizer(in.readLine()); return str.nextToken(); } private int nextInt() thr...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
9415af136755895cf6e935d1ca92d0de
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; import java.io.*; public class Main { BufferedReader in; StringTokenizer str = null; PrintWriter out; private String next() throws Exception{ while (str == null || !str.hasMoreElements()) str = new StringTokenizer(in.readLine()); return str.nextToken(); } private int nextInt() thr...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
ab24965074a28d5f19409dc06a363f8f
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*;; public class serial { public static char[][][] squares; public static boolean[][][] visited; public static void main(String args[]) { Scanner in = new Scanner(System.in); int l = in.nextInt(); int r = in.nextInt(); int c = in.nextInt(); squares = new ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
d4a90b540e709521f3f2fd8d29bd9f40
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.net.*; import java.io.*; public class imba2 { public static void main( String[] args ) throws Exception { Scanner file = new Scanner(System.in); int n , m , bb; bb= file.nextInt(); n = file.nextInt(); m = file.nextInt(); cha...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
5f032e2e8b762683d140f2067d88397e
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class WaterFill { static int n_x; static int n_y; static int n_z; static char a[][][]; static class Point { public int x; public int y; public int z; Point(int x, int y, int z) { this.x = x; this.y = y; ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
1a931e9baecbb91fa2136dd786031900
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
/* * @Author: steve * @Date: 2015-12-10 21:43:46 * @Last Modified by: steve * @Last Modified time: 2015-12-10 22:01:39 */ import java.io.*; import java.util.*; public class SerialTime { public static boolean[][][] matriz, visitados; public static int cont,k,n,m; public static void main(String[] args) thro...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
4e69789926ddc6ef14d56a6bc7f2af36
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class R56qBSerialTime { static char rect[][][]; static boolean vis[][][]; static int k,n,m; static int dk[],dx[],dy[]; public static void main(String args[] ) throws Exception ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
2125f3e51b36eabfda055ce94bed6de4
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; /** * * @author Mbt */ public class G { public static void main(String[] args) throws IOException { new Solver().solve(); } } class Solver{ final int MAXNMK= 11; c...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
75eeb2f6f9b594897f6f31bf9a2857a1
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Solution { static int result = 0; static int n, m, k; static int[][][] d; static boolean[][][] visited; static int[] hx = {-1, 0, 1, 0, 0, 0}; static int[] hy = {0, 1, 0, -1, 0, 0}; static int[] hl = {0, 0, 0, 0, -1, 1};...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
aa833a39752931f154e836533469fcba
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class serial { static int height, numRows, numCols; static char[][][] sink; static int[] dh = {1, -1, 0, 0, 0, 0}; static int[] dr = {0, 0, 1, -1, 0, 0}; static int[] dc = {0, 0, 0, 0, -1, 1}; public static void main(String args[]) { Scanner in = new Scanner(System.in); height = in...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
b006883234d834a2673146c30fa404ca
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; public class b56{ static int k,n,m; public static void main(String[] args) { MyScanner obj = new MyScanner(); k=obj.nextInt(); n=obj.nextInt(); m=obj.nextInt(); String s; char ar[][][]=new char[k][n][m]; int dz[]={0,0,0,0,-1,1}; ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
af457bd66c58e29c3cee60569da42531
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; public class bb56{ static int k,n,m; public static void main(String[] args) { MyScanner obj = new MyScanner(); k=obj.nextInt(); n=obj.nextInt(); m=obj.nextInt(); int count=0; String s; char ar[][][]=new char[k+5][n+5][m+5]; in...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
31f8afb664e50407c4e393a8661f38c1
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; import java.io.*; public class serialtime{ public static int tantos = 0; public static boolean maz[][][]; public static boolean vis[][][]; public static void main(String args[]) throws IOException{ BufferedReader lector = new BufferedReader(new InputStreamReader(System.in)); String t[] = lector.read...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
70baacee81b442731a5f8e4820325911
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; import java.io.*; public class SerialTime { public static void main(String[] args) { Scanner in = new Scanner(System.in); int k = in.nextInt(); int n = in.nextInt(); int m = in.nextInt(); char[][][] plate = new char[k][n][m]; for(int x = 0; x < k; x++) { for(int y = 0; y ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
48a77bf627ff0e3ca23a692d29fb7e67
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; public class B60 { static int a[][][]; static boolean[][][] was; static int count; static int k; static int n; static int m; static boolean check(int x, int y, int z) { return ((x < k) && (x >= 0) && (y < n) && (y >= 0) && (z < m) && (z >= 0)); } static void dfs(int ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
132c95d177cc8f670930651f972586a4
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.Scanner; public class Main { private static char[][][] plate; static int l,n,m; static final int[] DX = {0,0,1,-1,0,0}; static final int[] DY = {0,0,0,0,1,-1}; static final int[] DZ = {1,-1,0,0,0,0}; static int answer = 0; static boolean legal(int i, int j, int k) { ...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
26dd94a8272cf8c92292e43e8b07dba0
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
//http://codeforces.com/problemset/problem/60/B import java.util.*; import java.io.*; public class Serial { public static void main(String args[]) { Scanner fin = new Scanner(System.in); int layers = fin.nextInt(); int rows = fin.nextInt(); int cols = fin.nextInt(); ch...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
c2b9c5ec36442de12351fc3281de8a48
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.lang.reflect.Constructor; import java.util.Arrays; import java.util.StringTokenizer; public class CodeG { static class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringT...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
bb9c5468e3991961098f9c5da1dcd3ad
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class SerialTime { int k; int n; int m; int x; int y; int[] dx = {1, 0, -1, 0, 0, 0}; int[] dy = {0, 1, 0, -1, 0, 0}; int[] dz = {0, 0, 0, 0, 1, -1}; char[][][] plate; Deque<Coord> toVisit; int visited; public static void main(String[] args) { SerialTime main = new SerialT...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
571f54d375d277880880f17e4da27aec
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class SerialTime { int k; int n; int m; int x; int y; int[] dx = {1, 0, -1, 0, 0, 0}; int[] dy = {0, 1, 0, -1, 0, 0}; int[] dz = {0, 0, 0, 0, 1, -1}; char[][][] plate; Deque<Coord> toVisit; int visited; public static void main(String[] args) { SerialTime main = new SerialT...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
38220f08954e23841974f371fdc1dae9
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; public class Pr60B { public static void main(String[] args) throws IOException { new Pr60B().run(); } BufferedReader in; PrintWriter out; StringTokenizer st; String nextToken() throws IOException { while (st == null || !st.hasMoreTokens()) { st = new StringTokenizer...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
f472a7938b22b8ff0df68fbdbed2205f
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.Scanner; public class Serial { private static int arrx[]= {1,0,0,-1,0,0}, arry[]={0,1,0,0,-1,0}, arrz[]={0,0,1,0,0,-1}; private static int[][][] connect; private static char[][][] bowl; // private static int count; public static void main(String args[]) { Scanner in = new Scanner(System.i...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
dfb32cffe2075efe9857dbfa69883b27
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; public class DFS_1 { private static boolean[][][] visited, matrix; public static void main(String[] args) { Scanner util = new Scanner(System.in); int k = util.nextInt(); int n = util.nextInt(); int m = util.nextInt(); util.nextLine(); util.nextLine(); matrix = new...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
169402bac3e5cfc1b3198f0ee3019981
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.Scanner; public class SerialTime { private static boolean[][][] plate; public static int check(int x, int y, int z) { int[] dz = { -1, 1, 0, 0, 0, 0 }; int[] dx = { 0, 0, -1, 1, 0, 0 }; int[] dy = { 0, 0, 0, 0, -1, 1 }; if(x < 0 || x >= plate.length || y < 0 || y >= plate[0].length || z...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
2a9601468350b44940e43c64df26cd60
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class P060B { public static void main(String[] args) { Scanner in = new Scanner(System.in); int K = in.nextInt(); int N = in.nextInt(); int M = in.nextInt(); boolean[][][] plate = new boolean[K][N][M]; boolean[][][] vis...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
3f6ede5771df8d8daff7e4bad6a8b9b1
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.LinkedList; import java.util.Scanner; public class B { static class Triple { int i, j, k; public Triple(int kk, int ii, int jj) { i = ii; j = jj; k = kk; } } public static void main(String[] args) { Scanner sc = new Scan...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
27942d1c28f5464c122088ea0bdd488c
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.Scanner; // 60B public class SerialTime { static int height; static int rows; static int cols; static int[] dx = new int[] { 1, 0, 0, -1, 0, 0 }; static int[] dy = new int[] { 0, 1, 0, 0, -1, 0 }; static int[] dz = new int[] { 0, 0, 1, 0, 0, -1 }; public static void main(String[] ar...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
4360685c2afafaf8c29416c33f2c9d7e
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; public class Main { static BufferedReader br; static PrintWriter out; static StringTokenizer st; static class Coor{ private int a; private int b; private int c; public Coor(int a, int b, int c){ this.a = a;...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
f0b2e2c70908fd9eb1c9e4491dd911e6
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import static java.lang.System.*; public class Solution60b { char[][][] mat; int lays, rows, cols; int[] dy = {1, -1, 0, 0, 0, 0}; int[] dr = {0, 0, 1, -1, 0, 0}; int[] dc = {0, 0, 0, 0, 1, -1}; public void run() throws Exception...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
fa018959b886f18f1d5ef5bb8cf83102
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.IOException; import java.util.Scanner; public class SerialTime { public static void main(String[] args) throws IOException { Scanner kb = new Scanner(System.in); int layers = kb.nextInt(); int rows = kb.nextInt(); int cols = kb.nextInt(); kb.nextLine(); kb.nextLine(); char [][][] map = n...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
9cd017ea07f3259f1cc807db2ef8f4b2
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.InputStream; import java.io.OutputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.File; import java.io.FileNotFoundException; import java.util.A...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
7d445e689b9a8e342621b7c2987f1135
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; public class SerialTime { static int[] dk = {1, -1, 0, 0, 0, 0}; static int[] dn = {0, 0, 1, -1, 0, 0}; static int[] dm = {0, 0, 0, 0, 1, -1}; public static void main(String[] args) { Scanner scan = new Scanner(System.in); int k = scan.nextInt(); int n = sc...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
0f379cd3e6a7d05a60dcb60ed35388a7
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Solution60B { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); int K = in.nextInt(), N = in.nextInt(), M = in.nextInt()...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
3dde3b01818916abc5b2ac5fc9524b22
train_003.jsonl
1298131200
The Cereal Guy's friend Serial Guy likes to watch soap operas. An episode is about to start, and he hasn't washed his plate yet. But he decided to at least put in under the tap to be filled with water. The plate can be represented by a parallelepiped k × n × m, that is, it has k layers (the first layer is the upper one...
256 megabytes
import java.util.*; /** * Created by kapilkrishnakumar on 9/11/15. */ public class CodeSerialTime { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); int n = sc.nextInt(); int m = sc.nextInt(); char[][][] plate = new cha...
Java
["1 1 1\n\n.\n\n1 1", "2 1 1\n\n.\n\n#\n\n1 1", "2 2 2\n\n.#\n##\n\n..\n..\n\n1 1", "3 2 2\n\n#.\n##\n\n#.\n.#\n\n..\n..\n\n1 2", "3 3 3\n\n.#.\n###\n##.\n\n.##\n###\n##.\n\n...\n...\n...\n\n1 1"]
2 seconds
["1", "1", "5", "7", "13"]
null
Java 7
standard input
[ "dsu", "dfs and similar" ]
3f6e5f6d9a35c6c9e71a7eeab4acf199
The first line contains three numbers k, n, m (1 ≀ k, n, m ≀ 10) which are the sizes of the plate. Then follow k rectangles consisting of n lines each containing m characters '.' or '#', which represents the "layers" of the plate in the order from the top to the bottom. The rectangles are separated by empty lines (see ...
1,400
The answer should contain a single number, showing in how many minutes the plate will be filled.
standard output
PASSED
2313d66cbe41843fbb209cf5693e611a
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.*; import java.io.*; import java.math.BigDecimal; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader inp = new InputReader(inputStream); PrintWriter...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
429865cb9b73a3f27b0a8a6ebea1dd9d
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.function.IntUnaryOperator; import java.util.function.LongUnaryOperator; public class Main { public static void main(String[] args) { new Main(); } public Main() { FastScanner fs = new FastScanner(); java.io.PrintWriter out = new java.io.PrintWriter(System.out); solve(fs, out); out.flush...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
d23a5684d7358e44c2a51e9676e28711
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; public class cf1342_Div2_C { public static long findCount(long r, long lcm, long b) { long div = r / lcm; long pro = div * lcm; long tot = r; if (div != 0) { tot -= Math.min(b, r - pro + 1); tot -= b * (div - 1); } return tot - Math.min(r, b - 1); } pub...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
6972dd4059c95a69ff144cd854105dbb
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; import java.math.*; public class C { public static void main(String[] args) throws Exception { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); PrintWriter out = new PrintWriter(new OutputStreamWr...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
f85d1d178d9a9ed72d1af8f309ea57c9
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { // https://codeforces.com/problemset/problem/1342/C // creating flag array , 1 where condition satisfies // length = 40000 bcz 1<=a,b <=200 public static int[] flag = new int[40005]; public static int a; public static int b;...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
31b645f6e190240a108c98980fc6afb1
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Main { static PrintWriter out = new PrintWriter(System.out); static Reader in = new Reader(); public static void main(String[] args) throws IOException { //Scanner sc = new Scanner(); Main solver = new Main(); s...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
bd0fc4df9ce4da0a16a5cae40387e6c6
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
8ccd85759ea3f3f7d0704b7f8029cba9
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.Objects; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { try (FastReader reader = new FastReader(); PrintWriter writer = new PrintWriter(System.out)) { int tc = reader.nextInt(); while (tc-- > 0) { ...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
789ad1ede39827bcaf27fc5e5107089a
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; /** * Name: YetAnotherCountingProblem * URL: https://codeforces.com/contest/1342/problem/C * rating: */ public class YetAnotherCountingProblem { static PrintWr...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
5dc0acd9e2fd6673275b05fc70fd9acb
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayDeque; import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.Objects; import java.util.Random; import java.util.StringTokenizer; public ...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
07675e9a002b0424d5e1c7fbc69ba61d
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.*; import java.io.*; public class YetAnotherCountingProblem { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out)); int t = Integer.parseI...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
3891c30e6b57482ec578e3ebc8ee72b9
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; public class c { public static void main(String[] args) throws IOException { FastScanner stdin = new FastScanner(System.in); PrintWriter out = new PrintWriter(System.out); int t = stdin.nextInt(); for (int z = 0; z < t; z ++) { long a = stdin.nextInt(); long...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
fd30a77878d3978d76c8b590a2583eff
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Solve8 { public static void main(String[] args) throws IOException { Prin...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
3ca92c71d98e168dff335d281bebd80e
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.IOException; import java.util.Scanner; public class C_YetAnotherCountingProblem { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int __ = 0; __ < T; __++) { final int a = sc.nextInt();...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
d9ed8d95539c8e0588f4b0e11415cec6
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.*;import java.io.*;import java.math.*; public class Main { static long f(long r,long lcm,long lt){ long n=r/lcm; long cnt=lt*n,st=lcm*n; for(int i=1;i<lt;i++){ if(st+i*1l>r) break; cnt++; } return cnt; ...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
21649d3285b75896ee72454594e2ff34
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.lang.*; import static java.lang.Math.*; public class Cf131 implements Runnable { static class InputReader { private InputStream stream; private byte[] buf = new byte[1024]; private int curChar; private...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
8750b63e3d5b73c2d904009eba11dd15
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; public class CF1342C extends PrintWriter { CF1342C() { super(System.out); } Scanner sc = new Scanner(System.in); public static void main(String[] $) { CF1342C o = new CF1342C(); o.main(); o.flush(); } int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } void ma...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
dbd6b6ce2935aaf8c757d1bcaa2678d9
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class Main{ static long [][] memo; static long [] pow = new long[33]; static ArrayList <Integer> [] graph; static Integer [] d; static int [] dist; static boolean[][] visited; public static void main(String[] args) {...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
067902edbe72a7cc2dc2b4b098af228a
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(outputStream); U...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
778cca9e784017a25188a67041049a47
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; public class Main{ static long lcm(long a,long b) { return (a/gcd(a,b))*b; } static long gcd(long a, long b) { if (b == 0) return a; return gcd(b, a % b); } public static void main(String[] args) throws Exception{ PrintWriter pw=new PrintWriter(System.out...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
90efd4ae18e77b73812249e7d71b2f7b
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelp...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
fce16211162b104ba156b45210915439
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
/** * @author egaeus * @mail sebegaeusprogram@gmail.com * @veredict Accepted * @url <https://codeforces.com/problemset/problem/1342/C> * @category math * @date 27/04/2012 **/ import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; import static java.lang.Integer.parse...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
c220dbb823bb4c457b06248216eb243c
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.StringTokenizer; // given a, b and q queries // each queries consist of 2 integer Li, Ri; // find the number of integer between Li, Ri such that ((x % a) % b) != ((x % b ) % a); /** @author Tran Anh Tai Ideas: if (a == b): return 0 directly; else WLOG, a > b -> let x = by + d with ...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
44c973c4719aff98f9657b5c93f7cdb7
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.*; import java.io.*; public class Main{ static boolean[] vis; //line 74 and 91 hasElement ans pth_fnd static int MOD=1000000007; // static int[] ans; static int cnt; static long set1=0,set2=0; // public static void main(String[] args) throws IOEx...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
196f40b28fb9b9a599d0f5ab1ed23874
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
/* package codechef; // don't place package name! */ import java.lang.*; import java.io.*; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import java.util.*; /* Name of the class has to be "Main" only if the class is public. */ public clas...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
f69486b2f6f0b394f57562b9c94ef16a
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; public class B { static int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); } static int lcm(int a, int b) { return a * b / gcd(a, b); } static long solve(long r, int a, int b, long lcm, int[][] first, ArrayList<int[]> loop) { long ans = 0; for (int[] x : lo...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
844ce25573f677112aaa9c27ec411ba0
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.*; import java.io.*; public class I { public I(FastScanner in, PrintWriter out, int test) { int a = in.nextInt(); int b = in.nextInt(); if (a > b) { int tmp = a; a = b; b = tmp; } int lcm = a * b / gcd(a, b); //...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
084a4a47ac5bcb3d8abbeb0f5fa52fa1
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.util.*; public class C { static Scanner sc; // Driver method public static void main(String args[]) throws FileNotFoundException { sc = new Scanner(new BufferedReader(new InputStreamReader(System.in))); /...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
1ac2a899d133e3eba955d5e47198beca
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.IOException; import java.util.Scanner; public class C_YetAnotherCountingProblem { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int __ = 0; __ < T; __++) { final int a = sc.nextInt(); ...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
eef1ac442eccdb11aeefd3929f30d2a5
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.IOException; import java.util.Scanner; public class C_YetAnotherCountingProblem { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for (int __ = 0; __ < T; __++) { final int a = sc.nextInt(); ...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
1431f5c87d15f5e2c2c39f6edd15a2b4
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = Sys...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
1ef3eefdd42f280f019fa121ad0521ca
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.util.Scanner; public class Codeforces { static Scanner sc = new Scanner(System.in); static Long gcd(Long a, Long b) { if(b == 0) return a; return gcd(b,a%b); } static Long getCount(Long lim, Long period, Long range) { long ans = 0L; long blocks = lim/per...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
a76adbe9cd0d7b09ce93e1dd3e2ddaab
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
/** * @author vivek * programming is thinking, not typing */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; public class C { private static void solveTC(int __) { /* Fo...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
23e5589df7529a5b4001669f62c5c1f1
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class C { static final boolean RUN_TIMING = false; static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1024); static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(S...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
f16aa4f613869ebb1c5d9d0f87eb9895
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class C { static final boolean RUN_TIMING = false; static PushbackReader in = new PushbackReader(new BufferedReader(new InputStreamReader(System.in)), 1024); static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(S...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
f531aee22e89f2fe0a5fed6c5d628481
train_003.jsonl
1587911700
You are given two integers $$$a$$$ and $$$b$$$, and $$$q$$$ queries. The $$$i$$$-th query consists of two numbers $$$l_i$$$ and $$$r_i$$$, and the answer to it is the number of integers $$$x$$$ such that $$$l_i \le x \le r_i$$$, and $$$((x \bmod a) \bmod b) \ne ((x \bmod b) \bmod a)$$$. Calculate the answer for each qu...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class cf1342c { static BufferedReader __in; static PrintWriter __out; static StringTokenizer input; public static void main(String[] args) throws IOException { __in = new BufferedRea...
Java
["2\n4 6 5\n1 1\n1 3\n1 5\n1 7\n1 9\n7 10 2\n7 8\n100 200"]
3.5 seconds
["0 0 0 2 4 \n0 91"]
null
Java 11
standard input
[ "number theory", "math" ]
a1effd6a0f6392f46f6aa487158fef7d
The first line contains one integer $$$t$$$ ($$$1 \le t \le 100$$$)Β β€” the number of test cases. Then the test cases follow. The first line of each test case contains three integers $$$a$$$, $$$b$$$ and $$$q$$$ ($$$1 \le a, b \le 200$$$; $$$1 \le q \le 500$$$). Then $$$q$$$ lines follow, each containing two integers $$$...
1,600
For each test case, print $$$q$$$ integersΒ β€” the answers to the queries of this test case in the order they appear.
standard output
PASSED
3d3ef886278653ded1070ac7b938c2bd
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.*; public class Trying { public static void main (String[] args) { Scanner enter = new Scanner(System.in); int n = enter.nextInt(), scores [] = new int [n], pos = 0, max = Integer.MIN_VALUE; String handles[] = new String [n]; for(int i = 0 ; i < n ; i++) ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
3ef0fb5bbcbbada91b7dec5d136f0dac
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.*; public class RoomLeader { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int max = Integer.MIN_VALUE; String winner = ""; for (int i = 0; i < n; i++) { String handle = in.next(); ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
eb261fdfe6f26c5f75eca4b449f057f0
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
/* package whatever; // 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 Leader { public static void main(String[] args) throws java.lang.Exception { Scanner f = new Scanner(System.in); int...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
eb2375acd9d0064ce47a0450bc0b934a
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.util.Arrays; import java.util.Comparator; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.math.BigInteger; import java.io.InputStream; /** * Built using CHelp...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
95edb28ac83446afad730cb1d75e8153
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.Scanner; public class Ishu { public static void main(String[] args) { Scanner scan=new Scanner(System.in); int n,i,j,max,index=0; int[][] a=new int[50][8]; String[] handle=new String[50]; n=scan.nextInt(); for(i=0;i<n;++i) { ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
a639d9474f86ecb6ab68ec945518f247
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Test { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); A[] as = new A[n]; for(int i=0;i<n;i++){ String name = in.next(); ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
2f36f5931fabca84f8495ad966dc06c1
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class R68A { static int k; public static void main (String[] args) throws java.lang.Exception { InputReader in = new InputReader(System.in); PrintWriter w = new PrintWriter(System.out); int n = in.nextInt(); Str...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
ac89119dfe8d7047e43f419ccd13ebd2
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import static java.lang.System.in; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { public static void main(String[] args) throws IOException { Scanner sc = ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
36e137adcaab796fa395d3a38f620bcd
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.*; import java.io.*; //1000 public class RoomLeader { static int N; static HashMap<String, Integer> points; public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
66efd6c98ded39ad7dd3c2c0aa8609cd
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.Scanner; public class ARoomLeader { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); String bh=""; int opScore=-400000; if(n==1) System.out.println(sc.next()); else { ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
ece50cfafdd4e207524b5369f8026381
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; public class SolutionA{ public static void main(String[] args){ new SolutionA().run(); } int n; String nick[]; int a[]; void solve(){ n = in.nextInt(); nick = new String[n]; a = new int[n]; for(int i = 0; i < n; i++){ nick[i] = in.next(); ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
92c0a9c31848ce805a35882cc8224b67
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.io.*; import java.util.*; public class A1008 { public static void main(String [] args) /*throws Exception*/ { InputStream inputReader = System.in; OutputStream outputReader = System.out; InputReader in = new InputReader(inputReader);//new InputReader(new FileInputStream(new File...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
2b8d1df77839f10a99dac3c8be1ed2ab
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.Scanner; public class CF74A { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); in.nextLine(); String names[] = new String[n]; int max = Integer.MIN_VALUE; int contestant = 0; for (int i = 0; i < n; i++) { names[i] = in.next(); int...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
2a28bd56047d280d712dd09ac3ecafb7
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
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.IOException; import java.io.InputStreamReader; import java.io.BufferedOutputStream; import java.util.TreeMap; import java.util.StringTokenizer; import java.util.Ma...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
e57c78a1d2faab590b05f1287cc62fb2
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
//package CF; import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class A { public static int score(String [][] info, int ind){ int res = Integer.p...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
baca8c4882b5105642a9edd73bdcf3da
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n=sc.nextInt(); String win=new String(); int res=Integer.MIN_VALUE; for(int i=0;i<n;i++){ String t=sc.next(); int temp=sc.nextI...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
f2fa406c8b37abd2ef191de95e4ca213
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.nio.Buffer; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.Iterator; import java.util.Map; import jav...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
cbf023f748f160d748b534ac4dde2917
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class Main extends PrintWriter { BufferedReader in; StringTokenizer stok; final Random rand = new Random(31); final int inf = (int) 1e9; final long linf = (long) 1e18; final static String IO = "_std"; void solve...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
8221c2610a5312fa72c1214394bd256b
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.util.*; public class Main { static String []first,last; public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); Winner cs[] = new Winner[n]; for (int i=0;i < n;i++) { cs[i] = new Winner( s.next(), s.nextInt() * 100 + s.nextInt() * -50 ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output
PASSED
31c9b93f565336f5ad1e939e6bce48ab
train_003.jsonl
1302879600
Let us remind you part of the rules of Codeforces. The given rules slightly simplified, use the problem statement as a formal document.In the beginning of the round the contestants are divided into rooms. Each room contains exactly n participants. During the contest the participants are suggested to solve five problems...
256 megabytes
import java.io.BufferedReader; //import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; //import java.io.FileReader; //import java.io.FileWriter; //import java.lang.StringBuilder; import java.util.StringTokenizer; //import java.lang.Comparable; //import ...
Java
["5\nPetr 3 1 490 920 1000 1200 0\ntourist 2 0 490 950 1100 1400 0\nEgor 7 0 480 900 950 0 1000\nc00lH4x0R 0 10 150 0 0 0 0\nsome_participant 2 1 450 720 900 0 0"]
2 seconds
["tourist"]
NoteThe number of points that each participant from the example earns, are as follows: Petr β€” 3860 tourist β€” 4140 Egor β€” 4030 c00lH4x0R β€”  - 350 some_participant β€” 2220 Thus, the leader of the room is tourist.
Java 8
standard input
[ "implementation" ]
b9dacff0cab78595296d697d22dce5d9
The first line contains an integer n, which is the number of contestants in the room (1 ≀ n ≀ 50). The next n lines contain the participants of a given room. The i-th line has the format of "handlei plusi minusi ai bi ci di ei" β€” it is the handle of a contestant, the number of successful hacks, the number of unsuccessf...
1,000
Print on the single line the handle of the room leader.
standard output