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
d92d76e57a46a969183d89fd634b543a
train_001.jsonl
1520583000
Oleg writes down the history of the days he lived. For each day he decides if it was good or bad. Oleg calls a non-empty sequence of days a zebra, if it starts with a bad day, ends with a bad day, and good and bad days are alternating in it. Let us denote bad days as 0 and good days as 1. Then, for example, sequences o...
512 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.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; import java.util.TreeSet; public class B...
Java
["0010100", "111"]
1 second
["3\n3 1 3 4\n3 2 5 6\n1 7", "-1"]
null
Java 8
standard input
[ "greedy" ]
37b34461876af7f2e845417268b55ffa
In the only line of input data there is a non-empty string s consisting of characters 0 and 1, which describes the history of Oleg's life. Its length (denoted as |s|) does not exceed 200 000 characters.
1,600
If there is a way to divide history into zebra subsequences, in the first line of output you should print an integer k (1 ≀ k ≀ |s|), the resulting number of subsequences. In the i-th of following k lines first print the integer li (1 ≀ li ≀ |s|), which is the length of the i-th subsequence, and then li indices of days...
standard output
PASSED
aa092d669b00437ed24685c8837b5b66
train_001.jsonl
1588775700
Uh oh! Applications to tech companies are due soon, and you've been procrastinating by doing contests instead! (Let's pretend for now that it is actually possible to get a job in these uncertain times.)You have completed many programming projects. In fact, there are exactly $$$n$$$ types of programming projects, and yo...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.FileNotFoundException; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.FileReader; import java.io....
Java
["10 32\n1 2 3 4 5 5 5 5 5 5", "5 8\n4 4 8 2 1"]
4 seconds
["1 2 3 3 3 4 4 4 4 4", "2 2 2 1 1"]
NoteFor the first test, the optimal answer is $$$f=-269$$$. Note that a larger $$$f$$$ value is possible if we ignored the constraint $$$\sum\limits_{i=1}^n b_i=k$$$.For the second test, the optimal answer is $$$f=9$$$.
Java 11
standard input
[ "binary search", "greedy", "math" ]
5c17e01d02df26148e87dcba60ddf499
The first line contains two integers $$$n$$$ and $$$k$$$ ($$$1\le n\le 10^5$$$, $$$1\le k\le \sum\limits_{i=1}^n a_i$$$)Β β€” the number of types of programming projects and the rΓ©sumΓ© size, respectively. The next line contains $$$n$$$ integers $$$a_1,\ldots,a_n$$$ ($$$1\le a_i\le 10^9$$$)Β β€” $$$a_i$$$ is equal to the numb...
2,700
In a single line, output $$$n$$$ integers $$$b_1,\ldots, b_n$$$ that achieve the maximum value of $$$f(b_1,\ldots,b_n)$$$, while satisfying the requirements $$$0\le b_i\le a_i$$$ and $$$\sum\limits_{i=1}^n b_i=k$$$. If there are multiple solutions, output any. Note that you do not have to output the value $$$f(b_1,\ldo...
standard output
PASSED
b7a619b1a53782fb4dfa0ed7cfc192cb
train_001.jsonl
1588775700
Uh oh! Applications to tech companies are due soon, and you've been procrastinating by doing contests instead! (Let's pretend for now that it is actually possible to get a job in these uncertain times.)You have completed many programming projects. In fact, there are exactly $$$n$$$ types of programming projects, and yo...
256 megabytes
//package round639; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; import java.util.PriorityQueue; public class D2 { InputStream is; PrintWriter out; String INPUT = ""; // a...
Java
["10 32\n1 2 3 4 5 5 5 5 5 5", "5 8\n4 4 8 2 1"]
4 seconds
["1 2 3 3 3 4 4 4 4 4", "2 2 2 1 1"]
NoteFor the first test, the optimal answer is $$$f=-269$$$. Note that a larger $$$f$$$ value is possible if we ignored the constraint $$$\sum\limits_{i=1}^n b_i=k$$$.For the second test, the optimal answer is $$$f=9$$$.
Java 11
standard input
[ "binary search", "greedy", "math" ]
5c17e01d02df26148e87dcba60ddf499
The first line contains two integers $$$n$$$ and $$$k$$$ ($$$1\le n\le 10^5$$$, $$$1\le k\le \sum\limits_{i=1}^n a_i$$$)Β β€” the number of types of programming projects and the rΓ©sumΓ© size, respectively. The next line contains $$$n$$$ integers $$$a_1,\ldots,a_n$$$ ($$$1\le a_i\le 10^9$$$)Β β€” $$$a_i$$$ is equal to the numb...
2,700
In a single line, output $$$n$$$ integers $$$b_1,\ldots, b_n$$$ that achieve the maximum value of $$$f(b_1,\ldots,b_n)$$$, while satisfying the requirements $$$0\le b_i\le a_i$$$ and $$$\sum\limits_{i=1}^n b_i=k$$$. If there are multiple solutions, output any. Note that you do not have to output the value $$$f(b_1,\ldo...
standard output
PASSED
aaae317cc30cf8f7ffc16f87cb018424
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.util.*; import java.io.*; public class Solution { FastScanner in; PrintWriter out; public void solve() throws IOException { int n = in.nextInt(); int m = in.nextInt(); long s = in.nextLong(); long[][] a = new long[n + 1][m + 1]; for (int w = 1; w <= n; w++) for (int h = 1; h <= m; h++) { ...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
48d39914bce03ddfb69922c793b07867
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.*; import java.util.*; import java.math.BigInteger; public class main { public static void main(String[] args) { Scanner r = new Scanner(System.in); int N = r.nextInt(); int M = r.nextInt(); int S = r.nextInt(); long ans = 0; for(int a = 1 ;a<=N; a+=2) for(int b = 1 ;b<=M; b+=2) ...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
ac5200244c147578668f3ce8025d0554
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class B3 { public static StreamTokenizer in = new StreamTokenizer(System.in); public static boolean bg = true; public static int ni() throws Exception { in.nextToken(); return (int)in.nval; } public static int[] intl(int n) throws Exception { ...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
c39036ff8b6893b8c7b4b0a5117c5f50
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Locale; import java.util.StringTokenizer; public class Solution { /** * @param args */ BufferedReader in; PrintWriter out; StringTokenizer st; String nextToken() throws...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
194a3344dd3a0508d12699e469639877
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner r = new Scanner(System.in); int N = r.nextInt(); int M = r.nextInt(); int S = r.nextInt(); int[][] L = new int[N + 10][M + 10]; for(int i = 0; i < N; i++) for(int j = 0; j < M; j++) L[1 + 2 * M...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
d5bcce2d25319bd9330b94b774b5a075
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.StringTokenizer; public clas...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
96e650987d1947a5a5aa477fad6701a6
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.IOException; import java.io.OutputStreamWriter; import java.math.BigDecimal; import java.io.BufferedWriter; import java.util.Locale; import java.util.InputMismatchException; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.math.BigInteger; import java.io.InputSt...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
327ecc1130acb18c3228bd9a5962eea3
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.util.*; public class Crosses { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); int m = cin.nextInt(); int s = cin.nextInt(); cin.close(); long ans = 0; for (int a = 1; a <= n; a += 2) { ...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
5d61b40bb59c406167a4fea5af1c1abf
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.*; import java.util.*; public class C { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; void solve() throws IOException { int n = nextInt(); int m = nextInt(); int s = nextInt(); long ret = 0; for (int x1 = 1; x1 <= n ...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
7941c4d2d209a648a1fa27e4975d13d6
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.*; import java.util.*; public class C { BufferedReader br; PrintWriter out; StringTokenizer st; boolean eof; void solve() throws IOException { int n = nextInt(); int m = nextInt(); int s = nextInt(); long ans = 0; // rectangles for (int h = 1; h <= n; h += 2) { if (s % h != 0...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
1fbf1f6d6110a6050aaf4462c26f28c5
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.*; import java.util.*; public class P215C { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int s = sc.nextInt(); for (int i = 0; i < memo.length; i++) Arrays.fill(memo[i], -1); ...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
ce9bdd666f86954860dd839ecceb5e22
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public Scanner sc; public void run() { int n = sc.nextInt(); int m = sc.nextInt(); int s = sc.nextInt(); long ans = 0; for (int n1 = 0; n1 * 2 + 1 <= n; n1++) for (int m1 = 0; m1 * 2 + 1 <= m; m1...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
78fb6a350b27c09e9654a59e9aab2df0
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.util.Scanner; import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author George Marcus */ public class Main { public static void main(String[] args) { InputStream inputSt...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
e56d8dc5f4efa504a1ab3125fc6ba698
train_001.jsonl
1344267000
There is a board with a grid consisting of n rows and m columns, the rows are numbered from 1 from top to bottom and the columns are numbered from 1 from left to right. In this grid we will denote the cell that lies on row number i and column number j as (i, j).A group of six numbers (a, b, c, d, x0, y0), where 0 ≀ a, ...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author RiaD */ public class Main {...
Java
["2 2 1", "3 4 5"]
2 seconds
["4", "4"]
NoteIn the first sample the sought groups of six numbers are: (0, 0, 0, 0, 1, 1), (0, 0, 0, 0, 1, 2), (0, 0, 0, 0, 2, 1), (0, 0, 0, 0, 2, 2).In the second sample the sought groups of six numbers are: (0, 1, 1, 0, 2, 2), (0, 1, 1, 0, 2, 3), (1, 0, 0, 1, 2, 2), (1, 0, 0, 1, 2, 3).
Java 7
standard input
[ "implementation", "brute force" ]
4aae1c6f52e2ca7029b5a003cf307795
The input consists of a single line containing three integers n, m and s (1 ≀ n, m ≀ 500, 1 ≀ s ≀ nΒ·m). The integers are separated by a space.
2,100
Print a single integer β€” the number of distinct groups of six integers that denote crosses with area s and that are fully placed on the n × m grid. Please, do not use the %lld specifier to read or write 64-bit integers in Π‘++. It is preferred to use the cin, cout streams or the %I64d specifier.
standard output
PASSED
f5765431834cf4351f5765df600728c1
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedReader; import java.io.Reader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; /** * Built using CHelper plug-in * Actual solution is at the top * @author Denis Nedelyaev */ public class Main {...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
028896e2a9e2b091d4b19fdf7c5e2581
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class Main { private static PrintWriter out; private static FastReader in; private static class FastReader { public BufferedReader reader; public StringTokenizer tokenizer; public FastReader(InputStream inputStream) { reade...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
82489f416c632ed5b9c46ac0cb697a62
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
/* username: leandro92 */ import java.util.*; import java.io.*; import java.math.*; public class Main implements Runnable { public void solve() throws IOException { int n = nextInt(); int m = nextInt(); String[] feature = new String[n]; for (int i = 0; i < n; i++) feature[i] = nextToken(); int[][]...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
3cfa5cd51007b1d89ee668d52f259104
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.Scanner; public class TaskD { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int m = sc.nextInt(); int[][] xaar = new int[n][m]; sc.nextLine(); for (int i = 0; i < xaar.length; i++) { S...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
f783e7b195e5bd4783864ffbbf2bbfa0
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.Reader; import java.io.FileInputStream; import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built u...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
388e2d0865fe4983065cd90fc7ff6537
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import static java.util.Arrays.*; public class D { private static final int mod = (int)1e9+7; final Random random = new Random(0); final IOFast io = new IOFast(); /// MAIN CODE public void run() throws IOException { // int TEST_CASE = Integer.parseInt...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
db99aee89169865cd300095a76cf2f54
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.math.BigDecimal; import java.util.*; public class A { public static void main(String[] args) throws IOException { Scanner in = new Scanner(System.in); int n = in.nextInt(); int m = in.nextInt(); char [][] _map = new char[n][m]; for(int i ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
c92eb5fe05fafb5a8ad91ebf7bb59794
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.*; public class cf_66_04 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc=new Scanner(System.in); int h=sc.nextInt(); int w=sc.nextInt(); String[] s=new String[h]; int[][] num=new int[h][w]; for(int i=0...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
6f88ee6b2ef0fa725b8c7125aaea1219
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.ArrayDeque; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.StringTokenizer; public class a { public s...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
6df5948281c5d5505b56bbf13f3e99c6
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.StringTokenizer; public class D{ static InputReader in; static PrintWriter out; static long[][] ar; ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
8065ea0d4240c781b41df6b8f147eb0e
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int value = 0; int row = sc.nextInt(); int column = sc.nextInt(); int[][] goal = new int[row][column]; int[][] operator = new int[row][column...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
7ce12a6a03176a4fb9c8fc2433b12bf4
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.Scanner; import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Rene */ public class Main { public static void main(String[] args) { InputStream inputStream = Sy...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
99e69d7156d697b17d44b0f0f454a339
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class CF { FastScanner in; PrintWriter out; void solve() { int n = in.nextInt(); int m = in.nextInt(); char[][] a = new char[n][]; for (int i = 0; i < n; i++) { a[i] = in.next().toCharArray(); } long[][] cur = new long[n][m]; int res = 0; for (int i =...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
f8134dcc44f82ab65a2b440db0287e2d
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.OutputStreamWriter; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @auth...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
76a4fc93abfb3969ab88053e40dcb71f
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top * @author PM */ public class Main { ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
efe7f384af757dbb0e6b40ff58aa1026
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top * @author Aldo Culquicondor */ public...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
7c00dec16c08861a9f8cf08c1a6a8b96
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top * @author Aldo Culquicondor */ public...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
a3863803a11012cc34a4eb2f53580adf
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top * @author Aldo Culquicondor */ public...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
74e54280178ce55600379aeea1c0018b
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class B{ public static boolean DEBUG = false; public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); StringTokenizer st; st = getst(br); ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
24a4213c3c7b81efa2797a2225c850af
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class D { BufferedReader in; StringTokenizer st; PrintWriter out; String next() throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(in.readLine()); return st.nextToken(); } int nextInt() throws Exception { return Integer...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
60ee89cbfb2fe9d09f8e4202744a355a
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.Serializable; import java.util.InputMismatchException; public class Main { static String s[] = new String[200]; static int val[][] = new int[200][200]; public static void main(String[] args) throws Exception { InputReader ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
2af7ea8251b5201ecfa55cc5b1a0b5df
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
// practice with rainboy import java.io.*; import java.util.*; public class CF549D extends PrintWriter { CF549D() { super(System.out, true); } Scanner sc = new Scanner(System.in); public static void main(String[] $) { CF549D o = new CF549D(); o.main(); o.flush(); } void main() { int n = sc.nextInt(); int m...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
168c27f5c09b2f4a14ca5c153a67f239
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
//package codeforces.looksery_cup_2015; import java.util.Scanner; /** * Created by shaolin on 4/28/17. */ public class B { static Scanner scanner; static int [][] grid; static int[][] feature; static int row, col; public static void main(String[] args) { scanner = new Scanner(System.in);...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
c3faa8de34ece6831d5c01009d28ac2d
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class D { void solve() throws IOException { in = new InputReader("__std"); out = new OutputWriter("__std"); int n = in.readInt(); int m = in.readInt(); char[][] p = new char[n][]; for (int i = 0; i < n; ++i) { ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
90c35005fcbd8088ac40c2f1fd38b927
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.*; import java.io.*; public class Main implements Runnable { public void solve() throws IOException { int R = nextInt(); int C = nextInt(); //Goal to make all the points zero int[][] map = new int[R][C]; fo...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
bbce8ee24274c6958e6542229338e3ee
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.InputMismatchException; import java.util.ArrayList; import java.io.InputStream; import java.util.List; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Collections; import java.io.IOException; /** * Built using CHelper plug-in * Actual solution is at the top */ public class...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
cf26946787df5ccee7b749a95a8e6c3e
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.ArrayList; import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top */ public ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
0e9fd89d4e0728cdae617397b8950288
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class Main extends PrintWriter { final Random rand = new Random(31); final int inf = (int) 1e9; final long linf = (long) 1e18; final static String IO_NAME = "_std"; int[][] t; int n, m; int sum(int x, int y) { ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
8677d11abc2da40796dd5dfb87f7bcee
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; 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 Main { public static void main(String[] args) throws Exce...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
6cb27dd0dc996997049bef81382b09c3
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.InputStream; import java.util.NoSuchElementException; import java.io.OutputStreamWriter; import java.math.BigInteger; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.io.IOException; /** *...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
5f4614580f957be2f41577f1af06d049
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.ArrayList; import java.io.InputStream; /** * Built using CHel...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
ee13c0af17393ed33ee03dba6d5ed1bd
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
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
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
3ecca353942f1f833f06fc988ed0c1f6
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class D { public static void main(String[] args) throws Exception { FinalScanner sc = new FinalScanner(); PrintWriter out = new PrintWriter(System.out); ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
8c55a2d8198b1ecb87e5d0c41a69f6d5
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.InputStream; import java.util.NoSuchElementException; import java.io.OutputStreamWriter; import java.math.BigInteger; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.io.IOException; /** *...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
a83073823c7d497da7efe7199741813d
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.util.*; import java.io.*; public class PrD { public static void main(String[] args) throws IOException { new PrD().run(); } FastScanner in; PrintWriter out; void run() throws IOException { in = new FastScanner(System.in); out = new PrintWriter(System.out, true); solve(); out.close(); } ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
68238fd76472e91c647cc54db68e2273
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public stat...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
f35bc60cf505b658185a896df9f8bcc6
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import static java.lang.Double.parseDouble; import static java.lang.Integer.parseInt; import static java.lang.Long.parseLong; import static java.lang.System.exit; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
082accf89fc3bde1e4712eebdb943c10
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class d1 { public static void main(String[] args) throws FileNotFoundException { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n = in.nextInt(); int m = in.nextInt(); String s[] = new String[n]; for (int i = 0; i < n; i...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
f98ec2585643d5ed6a039acaefcf8830
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class D { void solve() throws IOException { int n = nextInt(); int m = nextInt(); int[][] mustGet = new int[n][m]; int[][] cur = new int[n][m]; for (int i = 0; i < n; i++) { String str = next(); for (int j = 0; j < str.length(); j++) { mustGet[i][j] = ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
0ac98df01608015286b6d008fc89c96f
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class Main { private FastScanner in; private PrintWriter out; public static void main(String[] args) { new Main().submit(); } public Main() { if (true) { in = new FastScanner(System.in); out = new PrintWriter(Sy...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
19c1bde22e4eda2e128d6b02ad680a5b
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; 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 CHelper plug-in * Actual solution is at the top * @author...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
cfa47dab0d5252a1ad656ac2a36464d5
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; import java.io.InputStream; import java.io.InputStreamReader; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
4d31f04154da5f78a56933c7a711ceee
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.Input...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
c983690711dc730a2a961fa4e8680302
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.Reader; import java.util.InputMismatchException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.io.IOException; /** * Built using CHelper plug-in * Actual solution ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
613f0f687efa7eb42a88dbc50aaf0a63
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
//package codeforcespractice; import java.io.*; import java.util.*; public class HaarFeatures { public static void main(String[] args) throws Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(br.readLine()); int n=Integer.parseInt(st.n...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
5e1c9b00615db05ce5fdb10797d97f47
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.awt.Point; import java.io.*; import java.util.*; public class D { InputStream is; int __t__ = 1; int __f__ = 0; int __FILE_DEBUG_FLAG__ = __f__; String __DEBUG_FILE_NAME__ = "src/T"; FastScanner in; PrintWriter out; public void solve() { int n = in.nextInt(), m = in.nextInt(); int[][] map ...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
4d6235a43b7273623373d0eb7572929f
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.*; import java.util.*; public class D { FastScanner in; PrintWriter out; void solve() { int n = in.nextInt(), m = in.nextInt(); int[][] cnt = new int[n][m]; for (int i = 0; i < n; i++) { String s = in.nextToken(); for (int j = 0; j < m; j++) { if (s.charAt(j) == 'W') { cnt[i][...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
81c454134fb042f9824b1251b784ea8c
train_001.jsonl
1433595600
The first algorithm for detecting a face on the image working in realtime was developed by Paul Viola and Michael Jones in 2001. A part of the algorithm is a procedure that computes Haar features. As part of this task, we consider a simplified model of this concept.Let's consider a rectangular image that is represented...
256 megabytes
import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.InputStream; import java.util.NoSuchElementException; import java.io.OutputStreamWriter; import java.math.BigInteger; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.io.IOException; /** *...
Java
["6 8\nBBBBBBBB\nBBBBBBBB\nBBBBBBBB\nWWWWWWWW\nWWWWWWWW\nWWWWWWWW", "3 3\nWBW\nBWW\nWWW", "3 6\nWWBBWW\nWWBBWW\nWWBBWW", "4 4\nBBBB\nBBBB\nBBBB\nBBBW"]
1 second
["2", "4", "3", "4"]
NoteThe first sample corresponds to feature B, the one shown in the picture. The value of this feature in an image of size 6 × 8 equals to the difference of the total brightness of the pixels in the lower and upper half of the image. To calculate its value, perform the following two operations: add the sum of pixels i...
Java 8
standard input
[ "implementation", "greedy" ]
ce6b65ca755d2d860fb76688b3d775db
The first line contains two space-separated integers n and m (1 ≀ n, m ≀ 100) β€” the number of rows and columns in the feature. Next n lines contain the description of the feature. Each line consists of m characters, the j-th character of the i-th line equals to "W", if this element of the feature is white and "B" if it...
1,900
Print a single number β€” the minimum number of operations that you need to make to calculate the value of the feature.
standard output
PASSED
693f90a465ceacfc22538332202abd56
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.InputMismatchException; import java.math.BigInteger; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
73d23f19e76111ceeb08f977ba2fb334
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.HashMap; import java.util.Scanner; import java.util.Vector; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author KHALED */ public class LittleGirlandG...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
7642c57b96c7d6fea91c25e14b32a01d
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.IOException; import java.io.OutputStreamWriter; import java.util.Arrays; import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.OutputStream; import java.io.PrintWriter; import java.util.NoSuchElementException; import java.io.Writer; import java.math.BigInteger; import jav...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
ae77a5f7e9ca4d3ebbfb073062bede20
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.*; public class lgg169 { public static void main(String ar[]) { Scanner obj=new Scanner(System.in); String s=obj.nextLine(); int a[]=new int[26]; Arrays.fill(a,0); for(int i=0;i<s.length();i++) a[s.charAt(i)-97]++; int count=0; for(int i=0;i<26;i++) { if(a[i]%2!=0) count+=1; } if(count<=1) System.out.p...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
89eaf5f7e21b74bf4ada4bf15d03d20e
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); boolean isPalindrome; Map<Character, Integer> counts = new HashMap<Character, Integer>(); ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
40cc1a870e55eb44b03379274e35bc33
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); boolean isPalindrome; int counts[] = new int[26]; for (char c : s.toCharArray()) { ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
86c87142981482bc195aa62be061906c
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringToken...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
66be412a792db0ae8105644992a3f253
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.math.BigInteger; import java.text.DecimalFormat; 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.Map; import java.util.PriorityQueue; import java.util.Scanner; import java.uti...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
0dd2bc33b0887c86ee3d0b6df3a11192
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.*; //PrintWriter import java.math.*; //BigInteger, BigDecimal import java.util.*; //StringTokenizer, ArrayList public class R169_Div2_B //Name: Little Girl and Game { FastReader in; PrintWriter out; public static void main(String[] args) { new R169_Div2_B().run(); } void run() { ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
1d708d8d72c17d943caf52f75c4f3dd5
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class B { static class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public String nextLine...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
444686e0dc558e044848bfc82d1270bc
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class Girl { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String a = sc.next(); int[] chars = new int[26]; for(int i = 0; i<a.length();i++){ chars[a.charAt(i)-'a']++; } int total = 0; for(int i:chars){ if (i%2!=0){ ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
4d38b6debf74f43e0808a9fe01f592f4
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class Prob276B { public static void main(String[] Args) { Scanner scan = new Scanner(System.in); int[] array = new int[26]; String s = scan.next(); for (int i = 0; i < s.length(); i++) array[s.charAt(i) - 'a']++; int odds = 0; for (int i = 0; i < array.length; i++) i...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
cad104e4dd75e59b3953107c411f570c
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author vadimmm */ public class Mai...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
372622e7f73555d7466a64ba015d43b5
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.IOException; import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.util.InputMismatchException; import java.io.OutputStream; import java.io.PrintWriter; import java.util.NoSuchElementException; import java.io.Writer; import java.math.BigInteger; import java.io.InputStream; /** *...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
7fbdab04ed8292627fc09bc3688615ce
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class CodeForces276B { public static void main(String args[]){ Scanner scan = new Scanner(System.in); String s =scan.nextLine(); char a[]=s.toCharArray(); int count[]=new int[26]; for(int i = 0;i<a.length;i++){ count[(int)a[i]-97...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
2c9e0d9b947a4de34580e01708f59323
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class Little_Girl_and_Game { public static void main(String args[]){ Scanner in = new Scanner(System.in); String s = in.next(); int k[] = new int[26]; int odd = 0; for(int i = 0 ; i < s.length() ; i++){ k[s...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
5932bd96e9480f79704f9bbba7f22b55
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; public class B { public static BufferedReader in; public static PrintWriter out; public static void main(String[] args) throws IOException { in = new BufferedReader(ne...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
1bd26e9982629d778ae94d4bd4b0f1ef
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { private String tokens[]; private BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main(String ar[]) throws IOException { Main demo = new Main(); demo.s...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
00a4eb8c00550d03b44502566929d10b
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.*; import java.util.*; public class LittleGirlAndGame { public static void main(String[] args) throws IOException { BufferedReader f = new BufferedReader(new InputStreamReader(System.in)); String str = f.readLine(); int[] a = new int[26]; for (int i = 0; i < str.lengt...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
435697f990927915acfe83975cbd6ef9
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class P276B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); sc.close(); char[] ch = new char[26]; for (int i = 0; i < s.length(); i++) ch[s.charAt(i) - 'a']++; int num...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
89900d687c3223a55fcc9e2718beec89
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args){ Scanner s = new Scanner(System.in); String input = s.next(); int[] a = new int[26]; Arrays.fill(a, 0); for(char ch: input.toCharArray()) a[ch - 'a']++; int count_odd = 0; ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
10b19b73413e40a6aaf5a05cf9e4fbd8
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
//package codeforces; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.List; import java.uti...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
9e9cac33fb1d075717f463e3a1867302
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * * @author Oreste */ public class Conejos { /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { BufferedReader entrada=new BufferedReade...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
e50da26e4daa249a9820828c67994664
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.StringTokenizer; public class Solution { static class Escanner { BufferedReader in; StringTokenizer st; Escanner() throw...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
59459e7b0b71387076318b0733dbf665
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.Scanner; public class Main { private static final InputStreamReader standardInput = new InputStreamReader(System.in); private static f...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
4a9d18d4aa55e74c097e2d35b9baf9ad
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.*; public class CF276B { public static void main(String... args) { String s = new Scanner(System.in).next(); int[] a = new int[26]; for (int i = 0, n = s.length(); i < n; i++) { a[s.charAt(i) - 'a']++; } int odds = 0; for (int i = 0; i < ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
9ce09c2993470a63a9a6189ad123d8e5
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; /** * Created with IntelliJ IDEA. * User: dima * Date: 24.02.13 * Time: 19:10 * To change this template use File | Settings | File Templates. */ public class TaskB { static BufferedR...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
ebc69a8af90fbfb8374ae1c2a25b5e56
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String... args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); boolean[] b = new boolean['z'-'a'+1]; for (char ch : s.toCharArray()){ b[ch-'a']=!b[ch-'a']; } int c = 0; for (int i=0; i<='z'-'a'; i++){ if (b[i]) c++; } System.o...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
df64dbdf865db05898ff38f87c938301
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.math.BigInteger; import java.util.StringTokenizer; import java.util.Scanner; public class CodeForces { public static void main(String[] args){ Scanner sin = new Scanner(Sys...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
cce65751f8adcfddb02320ce411ff981
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class B276 { public static void main(String[] args) { Scanner input = new Scanner(System.in); String s = input.next(); int[] stats = new int[26]; for (int i=0; i<s.length(); i++) { stats[s.charAt(i)-'a']++; } int odd = 0;...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
df3e3d4e5ecbe52be7d38fe4944060f2
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ //package acm.prepare; import java.io.IOException; import java.util.Scanner; /** * * @author Rock */ public class Kolo { publ...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
718340bbf5e937c06a5fd01a48439f1d
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.PrintWriter; import java.util.InputMismatchException; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top * @author Vaibhav Mittal */ public class Main { public static void main(String[] args) { Inp...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
32616024f9dc7a06652c6c3d3191affd
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.math.BigInteger; /** * * @author sousnake */ public class dp3 { static int arr[] ; public static void...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
8f2e85b7432665d10cdf4e1269bd15f5
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class A { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan=new Scanner(System.in); String s=scan.next(); boolean [] array= new boolean[s.length()]; for...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output
PASSED
b546ebfdc65cccff07ec2e44dc6d5485
train_001.jsonl
1361719800
The Little Girl loves problems on games very much. Here's one of them.Two players have got a string s, consisting of lowercase English letters. They play a game that is described by the following rules: The players move in turns; In one move the player can remove an arbitrary letter from string s. If the player befor...
256 megabytes
import java.util.Scanner; public class A { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner scan=new Scanner(System.in); String s=scan.next(); boolean [] array= new boolean[s.length()]; for...
Java
["aba", "abca"]
2 seconds
["First", "Second"]
null
Java 7
standard input
[ "greedy", "games" ]
bbf2dbdea6dd3aa45250ab5a86833558
The input contains a single line, containing string s (1 ≀ |s|  ≀  103). String s consists of lowercase English letters.
1,300
In a single line print word "First" if the first player wins (provided that both players play optimally well). Otherwise, print word "Second". Print the words without the quotes.
standard output