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
24220c82b1b636bb681c08f61efef010
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class OmNomAndSpiders { public static void main(String[] args) { InputReader r = new Input...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -> .*U -> L.R -> ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
9e5e539c092ecf44fdf34df731d6e193
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.util.Scanner; public class Test1{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); int k=sc.nextInt(); int[] no=new int[m]; for(int i=0;i<n;i++){ String str=sc.next(); //System.out.println(str); ...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
2c371d48a7c9c1321fa92fa77b8cd5a1
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; public class CF_ZCR14_B { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String[] line = br.readLine().split("\\s+"); ...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
b3b1f2fb34c773ac51446a4c28cfaff6
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.*; import java.util.*; public class Spider { public static void main(String []av) { Scanner s = new Scanner(); int n = s.nextInt(); int m = s.nextInt(); int k = s.nextInt(); char [][]p = new char[n][]; for (int i = 0; i < n; i++) { p[i] = s...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
c32e610bb43a9e4bcbc6c2a863af83bb
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.*; import java.util.StringTokenizer; import java.util.regex.Matcher; import java.util.regex.Pattern; public class Main { PrintWriter out; BufferedReader input; Main() { try { input = new BufferedReader(new FileReader("input.t...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
8a10a7dfe8ae8e9f17c17d99fa723d53
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.Stack; import java.util.StringTokenizer; public class OmNomAndSpiders { public static void main(String[] args) throws IOException { Buffere...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
a953931fcf7186dd4035bfad25751ab4
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class B { BufferedReader reader; StringTokenizer tokenizer; PrintWriter out; public void solve() throws IOException { int N = nextInt(); int...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
61a95f1c39c3bb3e95e97bdb1fa3abe6
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; /** * Created by Vadim */ public class B1 { static int n; static int m; public static void main(St...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
9b762d653183fec471d5cf2fcbc2c22a
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.*; import java.util.*; public class Spider { static public class FastScanner { java.io.BufferedReader br; StringTokenizer st; public FastScanner() { init(); } public FastScanner(String name) { init(name); } public FastScanner(boolean isOnlineJudge) { if (!isOnlineJudge || Syst...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
31434c8107ee467f7e9c1ec73fd739d4
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
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 */ public class Main { public static ...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
0474297a5317614df2525d8747cf52a1
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.util.*; import java.math.*; import java.io.*; public class B { public static long time = 0; public static void main(String[] args) throws Exception { time = System.currentTimeMillis(); IN = System.in; OUT = System.out; in = new BufferedReader(new InputStreamReader(IN)); out = new PrintWriter(...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
dd198db0bb14dd2bd90e7988aa6c5f61
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.util.*; import java.io.*; public class Main implements Runnable { char[][] map; int N, M, K; public void solve() throws IOException { N = nextInt(); M = nextInt(); K = nextInt(); map = new char[N][M]; for(int i = 0; i < N; i++) map[i] = nextTok...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
b17a1430a4783b4a22747e95c770b51e
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.OutputStream; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static ...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
b3827169bfd68b5803fac8cf574157fb
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class B implements Runnable { void solve() { int n = nextInt(), m = nextInt(), k = nextInt(); int[] ans = new int[m]; for (int i = 0; i < n; i++) { char[] c = nextString().toCharArray(); for (int j = 0; j < m; j++) { if (c[j] == 'U' &...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
c10b8b70ce349d87b1760acb4979d0a1
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.util.Scanner; public class A { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int m = scanner.nextInt(); scanner.nextLine(); String s[] = new String[n]; for (int i = 0; i < n; i++) ...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
ba3c2fe5be6593c793442da5ce01b1f5
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.util.*; import java.io.*; public class A { FastScanner in; PrintWriter out; public void solve() throws IOException { int n = in.nextInt(), m = in.nextInt(), k = in.nextInt(); char[][] c = new char[n][m]; for (int i = 0; i < n; i++) c[i] = in.next().toCharArray(); int[] res = new int[m]; fo...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
da7027d56a57afd911573522a6ae5684
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.*; import java.util.*; public class Main implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer st; String nextToken() throws IOException { while (st == null || !st.hasMoreTokens()) { st = new StringTokenizer(in.readLine()); } retur...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
2c910b0aa8f4e8dc9a4a4ed5880f9537
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; /** * * @author Mbt */ public class B { public static void main(String[] args) throws IOException { new Solver().solve(); ...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
8ffad5d381853a7c35d316736233321a
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.util.Scanner; public class OmNomB { /** * @param args */ static char[][]grid; public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); int k=sc.nextInt(); grid=new char[n][m]; for(int i=0;i<n;i++){ String s=sc.next(...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
b50a09c140bbb4b163352f3faadfe10b
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.util.Scanner; public class pa63 { public static void main(String args[]){ Scanner sc=new Scanner(System.in); int n=sc.nextInt(); int m=sc.nextInt(); int k=sc.nextInt(); int[] no=new int[m]; for(int i=0;i<n;i++){ String str=sc.next(); //System.out.println(str); for(int j=0;j<m;j++){ char c=st...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
27e5209b16353105937300907bc3b4e2
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.IOException; import java.util.Arrays; import java.io.FilterInputStream; import java.util.HashMap; import java.io.OutputStream; import java.io.PrintWriter; import java.util.TreeSet; import java.io.BufferedInputStream; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
8e3140d61f6e99d7602f1eb2796ab2ca
train_002.jsonl
1402673400
Om Nom really likes candies and doesn't like spiders as they frequently steal candies. One day Om Nom fancied a walk in a park. Unfortunately, the park has some spiders and Om Nom doesn't want to see them at all. The park can be represented as a rectangular n × m field. The park has k spiders, each spider at time 0 is...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.*; public class ZeptoB { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); ...
Java
["3 3 4\n...\nR.L\nR.U", "2 2 2\n..\nRL", "2 2 2\n..\nLR", "3 4 8\n....\nRRLL\nUUUU", "2 2 2\n..\nUU"]
3 seconds
["0 2 2", "1 1", "0 0", "1 3 3 1", "0 0"]
NoteConsider the first sample. The notes below show how the spider arrangement changes on the field over time:... ... ..U ...R.L -&gt; .*U -&gt; L.R -&gt; ...R.U .R. ..R ...Character "*" represents a cell that contains two spiders at the same time. If Om Nom starts fr...
Java 7
standard input
[ "implementation", "math" ]
d8c89bb83592a1ff1b639f7d53056d67
The first line contains three integers n, m, k (2 ≤ n, m ≤ 2000; 0 ≤ k ≤ m(n - 1)). Each of the next n lines contains m characters — the description of the park. The characters in the i-th line describe the i-th row of the park field. If the character in the line equals ".", that means that the corresponding cell of t...
1,400
Print m integers: the j-th integer must show the number of spiders Om Nom will see if he starts his walk from the j-th cell of the first row. The cells in any row of the field are numbered from left to right.
standard output
PASSED
907d075397d9dab7350dd3be290fe3b8
train_002.jsonl
1351783800
You have n friends and you want to take m pictures of them. Exactly two of your friends should appear in each picture and no two pictures should contain the same pair of your friends. So if you have n = 3 friends you can take 3 different pictures, each containing a pair of your friends.Each of your friends has an attra...
256 megabytes
import java.io.OutputStreamWriter; import java.io.BufferedWriter; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Random; import java.io.Writer; import java.util.Map; import java.io.IOException; import java.util.Arrays; import java.util.InputMismatchException; import java.util.AbstractSet; imp...
Java
["3 1\n1 2 3", "3 2\n1 2 3", "3 3\n1 2 3"]
6 seconds
["3", "5", "6"]
null
Java 6
standard input
[ "data structures", "binary search", "bitmasks", "math" ]
37f144cbbc722910abb7b23f6c0d471b
The first line of input contains two integers n and m — the number of friends and the number of pictures that you want to take. Next line contains n space-separated integers a1, a2, ..., an (0 ≤ ai ≤ 109) — the values of attractiveness of the friends.
2,700
The only line of output should contain an integer — the optimal total sum of attractiveness of your pictures.
standard output
PASSED
99cd8af9f9a15c77eab9bf832c5313bd
train_002.jsonl
1351783800
You have n friends and you want to take m pictures of them. Exactly two of your friends should appear in each picture and no two pictures should contain the same pair of your friends. So if you have n = 3 friends you can take 3 different pictures, each containing a pair of your friends.Each of your friends has an attra...
256 megabytes
//package bayan2012; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; public class B { InputStream is; PrintWriter out; String INPUT = ""; void solve() { int n = ni(); long m = nl(); long[] a = new long[n]; ...
Java
["3 1\n1 2 3", "3 2\n1 2 3", "3 3\n1 2 3"]
6 seconds
["3", "5", "6"]
null
Java 6
standard input
[ "data structures", "binary search", "bitmasks", "math" ]
37f144cbbc722910abb7b23f6c0d471b
The first line of input contains two integers n and m — the number of friends and the number of pictures that you want to take. Next line contains n space-separated integers a1, a2, ..., an (0 ≤ ai ≤ 109) — the values of attractiveness of the friends.
2,700
The only line of output should contain an integer — the optimal total sum of attractiveness of your pictures.
standard output
PASSED
cc3651ed8da2e98193bdb592528aa3e9
train_002.jsonl
1351783800
You have n friends and you want to take m pictures of them. Exactly two of your friends should appear in each picture and no two pictures should contain the same pair of your friends. So if you have n = 3 friends you can take 3 different pictures, each containing a pair of your friends.Each of your friends has an attra...
256 megabytes
//package prac; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.InputMismatchException; public class BayanB2 { InputStream is; PrintWriter out; String INPUT = ""; void solve() { int D = 30; int...
Java
["3 1\n1 2 3", "3 2\n1 2 3", "3 3\n1 2 3"]
6 seconds
["3", "5", "6"]
null
Java 6
standard input
[ "data structures", "binary search", "bitmasks", "math" ]
37f144cbbc722910abb7b23f6c0d471b
The first line of input contains two integers n and m — the number of friends and the number of pictures that you want to take. Next line contains n space-separated integers a1, a2, ..., an (0 ≤ ai ≤ 109) — the values of attractiveness of the friends.
2,700
The only line of output should contain an integer — the optimal total sum of attractiveness of your pictures.
standard output
PASSED
eae4e3d2f4567fef7dfbf78f7780e412
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); for (int i = 0; i < n; i++) { String line = sc.nextLine(); //System.out.println(line); if (line.startsWith("miao.") && !line.en...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
7ebd00778ab38afea3e62c29ac87959c
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; import java.io.*; public class a { static long mod = 1000000000l; public static void main(String[] args) throws IOException { input.init(System.in); PrintWriter out = new PrintWriter(System.out); int T = input.nextInt(); for(int t = 0; t<T; t++) { String s = input.nextLine(); int res...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
19e6649ba3f01823bddc62f421b0d1a0
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class A { public static void main(String... strinh) { List<String> strList = new ArrayList<String>(); Scanner cin = new Scanner(System.in); int n = 5; int i = 0; if (cin.hasNextInt()) { n = cin.nextInt(); }; c...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
90309af8d88cc404aabb958c7b7d5ca1
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.text.BreakIterator; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.PriorityQueue; import java.util.Queue; import java.util....
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
d78f0a70e682af6151cfebeb45602ce3
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
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.*; public class A implements Runnable { private void solve() throws IOException { int n = nextInt(); while (n-- > 0) { String s = reader.readL...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
c597db1f7aa5c29129060ed91d3aa4f2
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; import java.io.*; public class d2_185_A { /** * @param args * @throws Exception */ public static void main(String[] args) throws Exception { // TODO Auto-generated method stub BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); Pri...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
6c1c48aade333bcf25f9a5dc8e038f41
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class A { static class Scanner{ BufferedReader br=null; StringTokenizer tk=null; public Scanner(){ br=new BufferedReader(new InputStreamReader(System.in)); } public Str...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
ba38dc8ea70dd3ba86f4f3abce7f3a2a
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Scanner; public class Prob312A { public static void main(String[] Args) { Scanner scan = new Scanner(System.in); int x = scan.nextInt(); scan.nextLine(); for (int i = 0; i < x; i++) { String s = scan.nextLine(); if (s.length() < 5) System.out.println("OMG>.< I don't know!"); else...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
c6e86c875426f352c416e50fbf8207d3
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedOutputStream; import java.io.BufferedReader; import java.io.IOException; import java.io.PrintWriter; import java.io.StreamTokenizer; import java.util.Scanner; public class Main implements Runnable { StreamTokenizer ST; PrintWriter out; BufferedReader br; Scanner in; public...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
e2a7a6a6b03b3a84bbe6a9ccaf35308d
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Scanner; /** * * @author satinder */ public class nmakamm { public static void main(String[] args) { Scanner obj=new Scanner(System.in); int num=obj.nextInt(); String iarr[]=new String[15]; String aarr[]=new String[15]; for(int i=0;i<=num;i++) { iarr...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
37b9f61a6dcb04c8cc496f976c808f04
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; import java.lang.reflect.Array; import java.math.BigInteger; import java.util.*; import javax.print.attribute.standard.MediaSize.ISO; public class Codeforces2 implements Runnable { private BufferedReader br = null; private PrintWriter pw = null; private StringTokenizer stk = new StringT...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
5a2fbbd890191ad33915b2ca8432cb72
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; public class main { public static void main(String args[]) throws Exception{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int N; boolean st, end; String line; N=Integer.parseInt(br.readLine()); while(N-->0){ lin...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
6f2b03d2825fce8bbbd5addcf0b05719
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.PrintWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.util.StringTokenizer; public class Solver { public static void main(String[] Args) t...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
f135a3bda93d345293c5851777fdb40c
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn = new Scanner(System.in); int n = scn.nextInt(); String Line = scn.nextLine(); for (int i = 0; i < n; i++) { Line = scn.nextLine(); //System.out.println(Line.s...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
7a475203d9d8f68c09ce728d4039b180
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; import java.util.*; public class Solution { BufferedReader in; StringTokenizer str; PrintWriter out; String SK; String next() throws IOException { while ((str == null) || (!str.hasMoreTokens())) { SK = in.readLine(); if (SK == null) return null; str = new ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
d6d27d61811e63665ca3e2acb05565ee
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; import java.math.*; public class Main { static Input in; static Output out; static final boolean OJ = System.getProperty("ONLINE_JUDGE") != null; public static void main(String[] args) throws IOException { in = new Input(OJ ? System.in : new FileInputStream("in.txt")); ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
779e0586716b5707faac940de4e2c92e
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.File; import java.io.PrintWriter; import java.util.Arrays; import java.util.Scanner; import static java.lang.Math.*; public class Main { public static void main(String[] args) throws Exception { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n=Integer.par...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
8e7800a0f7a2e5e807cdc20728821796
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Scanner; public class Whosesentenceisit { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); input.nextLine(); String s; boolean start, end; for (int i = 0; i < n; ++i) { s = input.nextLine(); start = s.startsWith("miao."); ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
f369e2aa81f1cea6c17cc5a0e5ec35d0
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; public class A312 { public static void main(String[] args){ Scanner br = new Scanner(System.in); int n = br.nextInt(); br.nextLine(); for(int i = 0;i<n;i++){ String line = br.nextLine(); if(line.startsWith("miao.") && line.endsWith("lala.")){ System.out.println("OMG>.< I don't kno...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
4ac48e62e37a4c225e4b159650789b24
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
//in the name of god import java.util.*; import java.io.*; public class Main { public static void main(String[] args)throws IOException{ Scanner s=new Scanner(System.in); int n=s.nextInt(); String f=s.nextLine(); for(int i=0;i<n;i++){ String g=s.nextLine(); if(g.startsWith("miao.")&&!g.endsWith("lala.")) System.out.p...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
9b78ded86de308671a5bed7cc2f386b5
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
// in the name fo god import java.util.*; import java.io.*; public class Main { public static void main(String[] args)throws IOException{ BufferedReader b=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(b.readLine()); for(int i=0;i<n;i++){ String g=b.readLine(); if(g.startsWith("miao.")&&!g...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
f5f3769191f21db85f3642d55863bf38
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { private static String chekLalaOrMiao(String l) { if (l.length() < 5) { return "OMG>.< I don't know!"; } else if (l.startsWith("miao.") && !(l.endsWith("lala."))) { return "Rainbow's"; } else i...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
ae482081962c7043819bc2995063c9c0
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Scanner; /** * * @author Javi */ public class WhoseSentence { private static String LALA = "lala."; private static String MIAO = "miao."; private static String FREDA = "Freda's"; private static String RAINBOW = "Rainbow's"; private static String OMG = "OMG>.< I don't know!"...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
188023e47d863e5a5339e2f14fe5f0d0
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
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 n = sc.nextInt(); sc.nextLine(); while(n-->0){ String cadena = sc.nextLine(); int leng = cadena.length(); boolean rainbow = false; boo...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
d6df5b224759b7cf241bf3ae4cbab23c
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; import java.util.*; import java.lang.*; import java.math.BigInteger; public class HelloWorld { InputReader input; PrintWriter output; void run(){ output = new PrintWriter(new OutputStreamWriter(System.out)); input = new InputReader(System.in); solve(); out...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
c71332213207736de231bdb6d67080fe
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; public class sentence{ public static void main(String[]args)throws IOException{ BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); byte x=Byte.parseByte(br.readLine());boolean flag; ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
91619f7f378a7e70d7cf4f5e61aeb3fa
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.DataInputStream; public class Main { public static void main(String args[])throws Exception { int nt,n,c; String a; //scanf("%d",&nt); DataInputStream dis=new DataInputStream(System.in); nt=Integer.parseInt(dis.readLine()); while(nt-->0) { //scanf("%c",&c); a...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
81e49bc2edab267afd7ed5fe8e6d01ec
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { String x = ""; Scanner k = new Scanner(System.in); int n = Integer.parseInt(k.nextLine()); for ( int i = 0 ; i<n ; i++) { x = k.nextLine(); if (x.length() < 5) System.out.println("OMG>.< I don't know!"); else...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
fc007d14d011de52087a84978577bbc3
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) throws Exception { BufferedReader stdin = new BufferedReader(new InputStreamReader( System.in)); int y = Integer.parseInt(new StringTokenizer(stdin.readLine()) .nextToke...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
f60f24e93bab3e0289c57d099d88fbe3
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Scanner; public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); sc.nextLine(); for (; x > 0; x--) { String s = sc.nextLine(); if (s.startsWith("miao.") && s.endsWith("lala.")) ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
3ffa72d1d9867d8574df73329deafc7b
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; public class sentence { public static void main(String[] args)throws IOException { BufferedReader bf = new BufferedReader (new InputStreamReader (System.in)); int tests = Integer.parseInt(bf.readLine()); for(int i = 0; i<tests; i++){ boolean rainbow = false; ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
92aaaecd486d9f489400e2ea1d90067d
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Writer; import java.util.InputMismatchException; public clas...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
2dac7293557f45dd93aeb374c6788a0f
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; import java.util.TreeSet; public class ProblemA { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = Integer.parseInt(s.nextLine()); for (int i = 0; i < n; i++...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
366295c2107e98993ca05718c87f8608
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); for(int i = 0; i < n; i++) { String line = scan.nextLine(); boolean f = line.endsWith(...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
ee099182ed39c1a887530eaedfc3d87e
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int TC = Integer.parseInt(in.nextLine()); for(int i = 0; i < TC; i++) { String line = in.nextLine(); boolean fred = false; boolean rainbo...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
9d6827630c2bd859f1181d234e95d4f6
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Scanner; public class r185d2a { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int N = scan.nextInt(); scan.nextLine(); for(int i=0; i < N; i++){ String line = scan.nextLine(); boolean lala = line.endsWith("lala."); boolean miao = line.startsW...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
f1ab2d63fd5292a664917a00cbad59e3
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws NumberFormatException , IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
b4fb89096152c994710d952b9d65b9b8
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class A { String line; StringTokenizer inputParser; BufferedReader is; FileInputStream fstream; DataInputStream in; String FInput=""; void openInput(String file) { if(file==null)is = new BufferedReader(new InputStreamReader(System.i...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
3c5e47bf9f73def5ed22527e240749ef
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.regex.*; import java.util.*; import java.io.*; import java.lang.*; import java.math.*; import static java.lang.System.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class P312A{ static PrintStream ps; public static void main(String[] args)throws Exception{ BufferedRead...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
1e59910002fc145adb99802d1e7f49ce
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; public class sentance { public static void main(String args[]) { Scanner input=new Scanner(System.in); int numOfSen=Integer.parseInt(input.nextLine()); String[] arr=new String[numOfSen]; for(int i=0;i<=numOfSen-1;i++) { String str=input.nextLine(); if (str.endsWith("lala...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
f19187b3ee236ad6be5c06e524a3c8b1
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.math.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int tc = in.nextInt(); String str = in.nextLine(); for(int t = 0;t<tc;t++) { str = in.nextLine(); if(str.star...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
fc8125ee1871803936b075fb28a68e23
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; public class Main{ public static void main (String[] args) throws IOException { BufferedReader buffer = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(buffer.readLine()); while(n-- > 0) { S...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
10aa9973c655f8ae22b809c3defc5a19
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; public class ProblemA { void run() { FastScanner sc = new FastScanner(System.in); int N = Integer.parseInt(sc.nextLine()); for (int i = 0; i < N; ++i) { String line = sc.nextLine(); boolean f = line.endsWith("lala."); boolean...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
943e4dff242ec1cb5f22aa26043b4d5a
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.awt.Point; import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.List; i...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
4a1c61f3dbab0b5d4e75fdd8199ad417
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; public class Main { public static void main (String [] args) throws IOException { BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); int n = Integer.parseInt(br.readLine()); int ch...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
ce0a812598dc7d9aedc8c4d3b52a1846
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; /** * Created with IntelliJ IDEA. * User: Alexander Shchegolev * Date: 26.05.13 * Time: 17:40 * To change this template use File | Settings | File Templates. */ public class One { public static void main(String[] arg...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
e6d3e15c1be14f13762274157156310c
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.*; public class whose { public static void main(String[]args)throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pr = new PrintWriter(System.out,true); int n = Integer.parseInt(in.readLine()); ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
ade20a805a13df5579f2069cd4ed7e92
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.Arrays; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Queue; import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); in...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
c76200dae7b0e3dd6ce2b12181e11f9f
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class CF { public static void main(String[] args) throws IOException { InputStream inpu...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
d7732b66a8c29402be58df2db2b02b96
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; import java.util.Map.Entry; import java.io.*; import java.awt.Point; import java.math.BigInteger; import static java.lang.Math.*; public class Codeforces_Solution_A implements Runnable{ final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; BufferedReader in; ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
eacdb6bcce4ce8037df52f66380cc402
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main { private static String chekLalaOrMiao(String l) { if (l.length() < 5) { return "OMG>.< I don't know!"; } else if (l.startsWith("miao.") && !(l.endsWith("lala."))) { return "Rainbow's"; } else i...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
bca5dab9011fd46e74a23808cf322ee5
train_002.jsonl
1369582200
One day, liouzhou_101 got a chat record of Freda and Rainbow. Out of curiosity, he wanted to know which sentences were said by Freda, and which were said by Rainbow. According to his experience, he thought that Freda always said "lala." at the end of her sentences, while Rainbow always said "miao." at the beginning of ...
256 megabytes
import java.util.*; public class WhoseSentence312A { public static void main(String[] args) { // Set up scanner Scanner sc = new Scanner(System.in); // System.out.println("Enter n"); String num = sc.nextLine(); int n = Integer.valueOf(num); for (int i=0; i<n; ...
Java
["5\nI will go to play with you lala.\nwow, welcome.\nmiao.lala.\nmiao.\nmiao ."]
2 seconds
["Freda's\nOMG&gt;.&lt; I don't know!\nOMG&gt;.&lt; I don't know!\nRainbow's\nOMG&gt;.&lt; I don't know!"]
null
Java 6
standard input
[ "implementation", "strings" ]
ee9ba877dee1a2843e885a18823cbff0
The first line of the input contains an integer n (1 ≤ n ≤ 10), number of sentences in the chat record. Each of the next n lines contains a sentence. A sentence is a string that contains only Latin letters (A-Z, a-z), underline (_), comma (,), point (.) and space ( ). Its length doesn’t exceed 100.
1,100
For each sentence, output "Freda's" if the sentence was said by Freda, "Rainbow's" if the sentence was said by Rainbow, or "OMG&gt;.&lt; I don't know!" if liouzhou_101 can’t recognize whose sentence it is. He can’t recognize a sentence if it begins with "miao." and ends with "lala.", or satisfies neither of the conditi...
standard output
PASSED
0086de9e1760db5448b013b6895f50b0
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; import java.util.Stack; public class Problem172E { private static BhtmlNode rootNode = new BhtmlNode(null); public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<String> tokens = new ArrayList<>(); ...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 8
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
2b7bd02288a0724fa4d0dd64053fe550
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.util.Scanner; import java.util.Stack; import java.util.List; import java.util.ArrayList; public class e { private static BhtmlNode rootNode = new BhtmlNode(null); public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<String> tokens = new ArrayList<>(); Stack<B...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 8
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
f29414ee3ecf2586c7efa22edd2905aa
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.util.Scanner; import java.util.Stack; import java.util.ArrayList; public class e { private final static BhtmlNode rootNode = new BhtmlNode(null); public static void main(String[] args) { Scanner sc = new Scanner(System.in); ArrayList<String> tokens = new ArrayList<>(); Stac...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 8
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
e96c1c511d33ada2a0b54a08e7ce2638
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.util.Scanner; import java.util.Stack; import java.util.List; import java.util.ArrayList; public class e { private static BhtmlNode rootNode = new BhtmlNode(null); public static void main(String[] args) { Scanner sc = new Scanner(System.in); List<String> tokens = new ArrayList<>(); Stack<B...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 8
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
ea49f88bba24abc786bcfdf27a4abce8
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.util.*; public class E implements Runnable { private MyScanner in; private PrintWriter out; private String getName(String s, int from, int to) { while (s.charAt(from) < 'a' || s.charAt(from) > 'z') { ++from; } while (s.charAt(to) < 'a' || s...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
30cc9bd793e16ad50d291e8eced5bca8
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; public class Solver { static StringTokenizer st; BufferedReader in; PrintWriter out; public sta...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
ff84a118976c689915b5d4ec1b73b0a6
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.awt.geom.*; import static java.lang.Math.*; public class Solution implements Runnable { static final int MAXN = 250100; ArrayList<Integer> g []; long hashcode []; long hashes []; int n, m; int answer; StringBuilder sb; boolean isClose...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
a826ecd6876ebb8b40807c0fc625d24a
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.util.*; public class E { char[] s; int p; int[] e; int res; int cur = 0; Map<String, Integer> map = new HashMap<String, Integer>(); StringBuffer sb = new StringBuffer(10); Tag getTag() { Tag r = new Tag(); r.type = 1; ++p; ...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
bad3a37da3f5e8ace2b7bca42c94b66f
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import javax.tools.ToolProvider; import java.io.*; import java.util.*; /** * @author Roman Elizarov */ public class Krok2012_E { private static final int MAX_DEPTH = 200000; public static void main(String[] args) throws IOException { new Krok2012_E().go(); } final List<String> tags = new ArrayList<Stri...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
3516bbf445c1a4d64c78854e22b7e919
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.util.List; import java.io.IOException; import java.util.InputMismatchException; import java.util.ArrayList; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.math.BigInteger; import java.io.InputStream; /** * Built using CHelper plug-in * Actual solution is at th...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
54807f21067d03807e089afd94e86e0f
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.awt.geom.Point2D; import java.text.*; import java.math.*; import java.util.*; public class Main implements Runnable { final String filename = "maxtest"; public void writeTest() throws Exception { for (int i = 0; i < 1000000 / 14; i++) { out.write("<a><b>"); } for (int i = 0;...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
cc98920be300abce5a721482854357c6
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.util.*; public class Solution { private StringTokenizer st; private BufferedReader in; private PrintWriter out; static class Tree { int tag; Tree[] subtrees; Tree(int tag) { this.tag = tag; } int query(int[] q, int i) { int ret = 0; if (i < q.length && tag...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
ad9557aed69ef8a6900c9ee13dd6d8d7
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; public class E172 { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedRead...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
b84a83f7af0c5186e9dd36a478dd5766
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.List; public class E172 { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); Pr...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
4259e8e06cdda6a7dca33a3b53af07db
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Codeforces implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer st; Random rnd; final long p = 43; final int maxLevel = 200000; int[] closePositions; long[] hashes; String[] tokens;...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
cce676e1acd7c365e601cf91a9c31c70
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.util.*; public class E { private static void solve() throws IOException { String document = br.readLine(); List<Tag> tags = getTags(document); int queries = Integer.parseInt(br.readLine()); while (queries-- > 0) { List<String> query = new ArrayList<String>(); StringTokeniz...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
6371b5df3addf2937d60d41760f0d6cd
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.*; import java.util.*; public class Solution { public static StringTokenizer tok = null; public static BufferedReader cin; public static String nextToken() throws Exception { if (tok == null || !tok.hasMoreTokens()) { tok = new StringTokenizer(cin.readLine()); } return tok.nextToken(); } ...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
ee5c5c3d8a34d1f4f10222370be8374b
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.HashMap; import java.util.Vector; public class Solution { static class Node { int id, maxSucc, minUnsucc, d; Node par; Vector<Node> ch; public Node(int I, int D) { ...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
41a44d50ca67fc0a3f99456d672968f5
train_002.jsonl
1333440000
This problem is about imaginary languages BHTML and BCSS, which slightly resemble HTML and CSS. Read the problem statement carefully as the resemblance is rather slight and the problem uses very simplified analogs.You are given a BHTML document that resembles HTML but is much simpler. It is recorded as a sequence of op...
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 */ public class Main { public static ...
Java
["&lt;a&gt;&lt;b&gt;&lt;b&gt;&lt;/b&gt;&lt;/b&gt;&lt;/a&gt;&lt;a&gt;&lt;b&gt;&lt;/b&gt;&lt;b&gt;&lt;v/&gt;&lt;/b&gt;&lt;/a&gt;&lt;b&gt;&lt;/b&gt;\n4\na\na b b\na b\nb a", "&lt;b&gt;&lt;aa/&gt;&lt;/b&gt;&lt;aa&gt;&lt;b/&gt;&lt;b/&gt;&lt;/aa&gt;\n5\naa b\nb\naa\nb aa\na"]
4 seconds
["2\n1\n4\n0", "2\n3\n2\n1\n0"]
null
Java 6
standard input
[ "*special", "dfs and similar", "expression parsing" ]
f8ae8984f1f497d9d15887c5a0429062
The first line of the input contains a BHTML-document. The document has length from 4 to 106 characters. The document has a correct structure, doesn't contain spaces or any other unnecessary characters. Tagnames consist of lowercase Latin letters, their lengths are from 1 to 10 characters. The second line contains an i...
2,200
Print m lines, the j-th line should contain the number of elements of the document that correspond to the j-th BCSS-rule. If there are no such elements at all, print on the line 0.
standard output
PASSED
bb728a794fd4ae486e6540b3933163e4
train_002.jsonl
1584974100
The King of Berland Polycarp LXXXIV has $$$n$$$ daughters. To establish his power to the neighbouring kingdoms he wants to marry his daughters to the princes of these kingdoms. As a lucky coincidence there are $$$n$$$ other kingdoms as well.So Polycarp LXXXIV has enumerated his daughters from $$$1$$$ to $$$n$$$ and the...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) throws java.lang.Exception { Scanner ab=new Scanner(System.in); int q=ab.nextInt(); while(q-->0) { int x=ab.nextInt(); int min=(int)1e6;int ind=-1; LinkedHashSet<Integer>set=new...
Java
["5\n4\n2 2 3\n2 1 2\n2 3 4\n1 3\n2\n0\n0\n3\n3 1 2 3\n3 1 2 3\n3 1 2 3\n1\n1 1\n4\n1 1\n1 2\n1 3\n1 4"]
2 seconds
["IMPROVE\n4 4\nIMPROVE\n1 1\nOPTIMAL\nOPTIMAL\nOPTIMAL"]
NoteThe first test case is depicted in the statement. Adding the fourth kingdom to the list of the fourth daughter makes her marry the prince of the fourth kingdom.In the second test case any new entry will increase the number of marriages from $$$0$$$ to $$$1$$$.In the third and the fourth test cases there is no way t...
Java 8
standard input
[ "greedy", "graphs", "brute force" ]
38911652b3c075354aa8adb2a4c6e362
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the number of daughters and the number of kingdoms. Each of the next $$$n$$$ lines contains ...
1,200
For each test case print the answer to it. Print "IMPROVE" in the first line if Polycarp LXXXIV can add some kingdom to some of his daughter's list so that the total number of married couples increases. The second line then should contain two integers — the index of the daughter and the index of the kingdom Polycarp LX...
standard output
PASSED
116f66e3a7bd47290ec8d6a01f74b3c7
train_002.jsonl
1584974100
The King of Berland Polycarp LXXXIV has $$$n$$$ daughters. To establish his power to the neighbouring kingdoms he wants to marry his daughters to the princes of these kingdoms. As a lucky coincidence there are $$$n$$$ other kingdoms as well.So Polycarp LXXXIV has enumerated his daughters from $$$1$$$ to $$$n$$$ and the...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; public class PrincessPrinc { public static void main(String[] args) { Scanner sc = new Scanner(System.in); // String in = sc.nextLine(); PrintWriter out = new PrintWriter(System.out); // StringTokenizer st = new StringTokenizer(...
Java
["5\n4\n2 2 3\n2 1 2\n2 3 4\n1 3\n2\n0\n0\n3\n3 1 2 3\n3 1 2 3\n3 1 2 3\n1\n1 1\n4\n1 1\n1 2\n1 3\n1 4"]
2 seconds
["IMPROVE\n4 4\nIMPROVE\n1 1\nOPTIMAL\nOPTIMAL\nOPTIMAL"]
NoteThe first test case is depicted in the statement. Adding the fourth kingdom to the list of the fourth daughter makes her marry the prince of the fourth kingdom.In the second test case any new entry will increase the number of marriages from $$$0$$$ to $$$1$$$.In the third and the fourth test cases there is no way t...
Java 8
standard input
[ "greedy", "graphs", "brute force" ]
38911652b3c075354aa8adb2a4c6e362
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the number of daughters and the number of kingdoms. Each of the next $$$n$$$ lines contains ...
1,200
For each test case print the answer to it. Print "IMPROVE" in the first line if Polycarp LXXXIV can add some kingdom to some of his daughter's list so that the total number of married couples increases. The second line then should contain two integers — the index of the daughter and the index of the kingdom Polycarp LX...
standard output
PASSED
2ab2aa5f098e06bc59c49f50eaf7a354
train_002.jsonl
1584974100
The King of Berland Polycarp LXXXIV has $$$n$$$ daughters. To establish his power to the neighbouring kingdoms he wants to marry his daughters to the princes of these kingdoms. As a lucky coincidence there are $$$n$$$ other kingdoms as well.So Polycarp LXXXIV has enumerated his daughters from $$$1$$$ to $$$n$$$ and the...
256 megabytes
import java.io.*; import java.util.*; public class Q2 { public static void main(String[] args) { InputReader in=new InputReader(); PrintWriter out=new PrintWriter(System.out); int t =in.nextInt(); while(t-->0){ int N =in.nextInt(); long ans =0; int c[]=new ...
Java
["5\n4\n2 2 3\n2 1 2\n2 3 4\n1 3\n2\n0\n0\n3\n3 1 2 3\n3 1 2 3\n3 1 2 3\n1\n1 1\n4\n1 1\n1 2\n1 3\n1 4"]
2 seconds
["IMPROVE\n4 4\nIMPROVE\n1 1\nOPTIMAL\nOPTIMAL\nOPTIMAL"]
NoteThe first test case is depicted in the statement. Adding the fourth kingdom to the list of the fourth daughter makes her marry the prince of the fourth kingdom.In the second test case any new entry will increase the number of marriages from $$$0$$$ to $$$1$$$.In the third and the fourth test cases there is no way t...
Java 8
standard input
[ "greedy", "graphs", "brute force" ]
38911652b3c075354aa8adb2a4c6e362
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the number of daughters and the number of kingdoms. Each of the next $$$n$$$ lines contains ...
1,200
For each test case print the answer to it. Print "IMPROVE" in the first line if Polycarp LXXXIV can add some kingdom to some of his daughter's list so that the total number of married couples increases. The second line then should contain two integers — the index of the daughter and the index of the kingdom Polycarp LX...
standard output
PASSED
478635bfd68553544cc1627da0502e94
train_002.jsonl
1584974100
The King of Berland Polycarp LXXXIV has $$$n$$$ daughters. To establish his power to the neighbouring kingdoms he wants to marry his daughters to the princes of these kingdoms. As a lucky coincidence there are $$$n$$$ other kingdoms as well.So Polycarp LXXXIV has enumerated his daughters from $$$1$$$ to $$$n$$$ and the...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; import java.math.*; import java.text.*; public class Prac{ static class InputReader { private final InputStream stream; private final byte[] buf = new byte[8192]; private int curChar, snumChars; public InputReader(Input...
Java
["5\n4\n2 2 3\n2 1 2\n2 3 4\n1 3\n2\n0\n0\n3\n3 1 2 3\n3 1 2 3\n3 1 2 3\n1\n1 1\n4\n1 1\n1 2\n1 3\n1 4"]
2 seconds
["IMPROVE\n4 4\nIMPROVE\n1 1\nOPTIMAL\nOPTIMAL\nOPTIMAL"]
NoteThe first test case is depicted in the statement. Adding the fourth kingdom to the list of the fourth daughter makes her marry the prince of the fourth kingdom.In the second test case any new entry will increase the number of marriages from $$$0$$$ to $$$1$$$.In the third and the fourth test cases there is no way t...
Java 8
standard input
[ "greedy", "graphs", "brute force" ]
38911652b3c075354aa8adb2a4c6e362
The first line contains a single integer $$$t$$$ ($$$1 \le t \le 10^5$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$) — the number of daughters and the number of kingdoms. Each of the next $$$n$$$ lines contains ...
1,200
For each test case print the answer to it. Print "IMPROVE" in the first line if Polycarp LXXXIV can add some kingdom to some of his daughter's list so that the total number of married couples increases. The second line then should contain two integers — the index of the daughter and the index of the kingdom Polycarp LX...
standard output