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
38771d4ed6becf5098f0bf9702d59ea9
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.util.*; import java.lang.*; import java.io.*; import java.math.*; public class evenSubSum{ static void count(ArrayList<Integer> a, int n) { int flag=0; int oddcount=0; int prev=0; int next=0; for(int i=0; i<n; i++) { if(a.get(i)%2==0) { flag=1; System.out.println("1"); ...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
72e5b39e6b78e65ab468bd13ffe30fa7
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.io.*; import java.util.*; import java.lang.*; public class GFG { public static void main (String[] args) { Scanner s = new Scanner(System.in); int t; t=s.nextInt(); for(int k=0;k<t;k++){ int oddcount=0; int N; N=s.nextInt(); int arr...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
53833d6440afcc9c0f77cac63cff05bc
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.io.*; import java.util.*; import java.lang.*; public class GFG { public static void main (String[] args) { Scanner s = new Scanner(System.in); int t; t=s.nextInt(); for(int k=0;k<t;k++){ int oddcount=0; int N; N=s.nextInt(); int ar...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
2f22d9805f3747ed8f62b0269f69149a
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.io.*; import java.util.*; public class A { static int n; static int[] arr; static String str; public static void main(String[] args) throws IOException { Flash f = new Flash(); int T = f.ni(); for(int tc = 1; tc <= T; tc++){ n = f.ni(); arr =...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
290b17a1fa005816f8ba647873b479fb
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; public class A { static int T; static int N; static int arr[]; static int Answer; static int seq[]; public static void main(String[] args) throws NumberForma...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
fd946893809853aa70947ccf51a34124
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.util.*; import java.io.*; import java.lang.Number; import java.math.BigInteger; public class sub { public static void main(String[] args) { InputReader reader = new InputReader(System.in); OutputWriter out = new OutputWriter(System.out); int t = reader.readInt(); for (i...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
368ca24c2f75a7a82a54e343f3e94bc4
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
// package com.algo.codeforces; import java.util.Scanner; public class EvenSubsetSum { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); String[] output = new String[t]; for (int i = 0; i < t; i++) { int n = s...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
8da7a01d008398a2e9450c5919af36a2
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
// package sec; import java.util.*; import java.lang.Math; public class hut { public static void main (String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for (int i = 0; i < t; i++) { int n=sc.nextInt(); int[] a=new int[n]; for (int j = 0; j < a.length; j++) { a[j]=sc.nextI...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
b44427db0570e1a5347b160a33ed7ca3
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.util.Arrays; import java.util.Scanner; public class Codeforces { private static Scanner scanner; public static void main(String[] args) { scanner = new Scanner(System.in); int t = Integer.parseInt(scanner.nextLine()); while (t-- > 0) { solve(); } } ...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
2cfb55283b0444c7658876e4716c1673
train_001.jsonl
1583573700
You are given an array $$$a$$$ consisting of $$$n$$$ positive integers. Find a non-empty subset of its elements such that their sum is even (i.e. divisible by $$$2$$$) or determine that there is no such subset.Both the given array and required subset may contain equal values.
512 megabytes
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { // FCApplicationManager applicationManager = new FCApplicationManager(); //applicationManager.init(); Scanner sc = new Scanner(System.in); Integer t...
Java
["3\n3\n1 4 3\n1\n15\n2\n3 5"]
1 second
["1\n2\n-1\n2\n1 2"]
NoteThere are three test cases in the example.In the first test case, you can choose the subset consisting of only the second element. Its sum is $$$4$$$ and it is even.In the second test case, there is only one non-empty subset of elements consisting of the first element, however sum in it is odd, so there is no solut...
Java 11
standard input
[ "dp", "implementation", "greedy", "brute force" ]
3fe51d644621962fe41c32a2d90c7f94
The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$), number of test cases to solve. Descriptions of $$$t$$$ test cases follow. A description of each test case consists of two lines. The first line contains a single integer $$$n$$$ ($$$1 \leq n \leq 100$$$), length of array $$$a$$$. The second lin...
800
For each test case output $$$-1$$$ if there is no such subset of elements. Otherwise output positive integer $$$k$$$, number of elements in the required subset. Then output $$$k$$$ distinct integers ($$$1 \leq p_i \leq n$$$), indexes of the chosen elements. If there are multiple solutions output any of them.
standard output
PASSED
5b7eca78c885e1f0348cf717f6398019
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.*; public class Solution { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); String s = sc.next(); String res = ""; while (s.length() != 0) { if (s.length() % 2 == 1) { res = res + s.charAt(0); } else { ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
99f3cb3072d80317373657a99ba4df59
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.Scanner; public class L16_B { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); String s=sc.next(); char[] a=new char[n]; int l,r; if (n % 2 != 0) { a[n/2]=s.charAt(0); ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
e88816b18118daa81f774758f8db0d2b
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.io.* ; import java.util.* ; import java.lang.* ; public class Main { public static void main( String[] args ) { Scanner in = new Scanner(System.in) ; int n = in.nextInt() ; String s = in.next() ; char[] ans = new char[n] ; int med=(n>>1) + ((1==(n&1))?0:-1), ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
8745717e7d02727f3a08bb68e2ed9179
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.*; public class Main { private static final Scanner scanner = new Scanner(System.in); public static void main(String[] args) { int n = scanner.nextInt(), a = 1, l = 1, R = 1; String s = scanner.next(); char[] c = new char[n]; if (s.length() % 2 == 0) { ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
28817a06e4553bcdf8337204dff7ea1e
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class Decoding { public static void main (String args[]){ Scanner s = new Scanner(System.in); int n=s.nextInt(); String word=s.next(); char[] beforDecode=word.toCharArray(); char[] afterDecode=new char[n]; if(n%2==1){ int index=1; afterDec...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
6f95ccf4e7ec50930e3e5f91e29923dd
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.Scanner; public class Decoding { public static void main(String [] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); StringBuffer str = new StringBuffer(); str.append(input.next()); StringBuffer ans = new StringBuffer(); ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
b037c0a95d961f0878bfd61ab1ccae6a
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.Scanner; public class Orden { public static void main(String[] args) { Scanner dato = new Scanner(System.in); int n = dato.nextInt(); String palabra = dato.next(); String resp= ""; for (int i = 0; i < n; i++) { if ((n...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
a2b9b9c4d8441a671a6ef9e4cf4e4700
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.*; public class solution { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); sc.nextLine(); String s=sc.nextLine(); String a=""+s.charAt(0); if(n%2==0) { for(int i=1;i<n;i++) { if(i%2!=0) { a+=s.charAt(i); } else { a...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
716eefb47ac0220293a05fca1c7a4f30
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
// Long Contest 1, Problem P import java.nio.charset.Charset; import java.lang.StringBuilder; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; public class Main { public static void main(String[] args) { Charset charset = Charset.forName("ascii"); FastIO rd = new FastIO(Syst...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
2093f3c37e0fa15313d6f94644f2217c
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
//package hiougyf; import java.io.*; import java.util.*; import java.util.Map.Entry; public class Solution { public static void main(String[] args){ Scanner sc =new Scanner(System.in); int n=sc.nextInt(); String s=sc.next(); String ans=""; ans+=s.charAt(0); if(n%2==0) { for(int i=1;i<n;i++) { if...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
7c47ae57ac83b98e9a0a944b6da3c8b6
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
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 Decoding { public static void main(String[] args) { InputStream inputStream = System.in; ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
b6c6d521cdac6b7bbf148ea75f4d3cb9
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.*; import java.math.*; public class Euler { public static void main(String[] args) { Scanner in=new Scanner(System.in); int n = in.nextInt(); String str = in.next(); String ans = ""; ans += str.charAt(0); for (int i = 1; i < n; i++) { if (i % 2 == 0) { ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
feeca4f11c817a22d773f4ad8a56ee61
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.Random; import java.util.StringTokenizer; public class Main { private static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); private static Lib l = new Lib(); /** * Decoding * https://codeforces.com/problemset/problem/74...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
38bd1baa9e787d136a00017d9e80bf10
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
// package com.company; import java.io.*; import java.util.*; /** * @ author jigar_nainuji_4_u */ public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String s = br....
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
88f5d1072063ee987a8c193ccac6b33a
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
// package test; import java.io.*; import java.util.* ; public class Testr { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()) ; String y = br.readLine(); StringBuilder k = new St...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
d59f6e259b27f0a57035f854b3b1047a
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.Scanner; public class p9 { public static void main(String[] args) { Scanner s=new Scanner(System.in); int n=s.nextInt(); s.nextLine(); String str=s.nextLine(); int right=n-1; int left=n-2; int idx1=0; int idx2=n-1; char[] arr=...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
064076dfdd8b36e0719ad5e79d3eda2f
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.LinkedList; import java.util.Scanner; public class main { public static void main(String args[]){ Scanner scanner = new Scanner(System.in); /* int len =scanner.nextInt(); String s = scanner.next(); int x = s.length(); String t = ""; for(int i = 0 ; i < x; i++...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
601745035b3ac6ecafc28e8e70bd837b
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.Scanner; public class League { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int size = sc.nextInt(); sc.nextLine(); String s = sc.nextLine(); String result = ""; int curr_len = size; for(int i =0; i<size; i++){ if((curr_len & 1) == 1){ re...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
f3c6e25e0514d5dec76b9637e93a140f
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); String s=sc.next(); int[] x=new int[n]; if(n%2!=0) { for(int i=n-2;i>=0;i-=2) { System.out.print(s.charAt(i)); } System.out.print(s.charAt(0)); for(int i=2;i<...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
c631fc869ec26c024a10e6920030972a
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.Scanner; public class Main { private static Scanner in = new Scanner(System.in); public static void main(String[] args) { // write your code here int len = in.nextInt(); String needed = "",given = in.next(); int i = 0; needed += given.charAt(0); len--; ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
5a010aebde16ad2afd5ee8282ce38d89
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.*; import java.lang.Math.*; public class CF { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); char c[]= sc.next().toCharArray(); char c1[]=new char[c.length]; int i=0; if(c.length==1) { System.out.println(c[0]); System.exit(0); } ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
868e55fdd4063e41729065e984ba930c
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class Decoding { public static void main(String[]args) { Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in))); int n=s.nextInt(); s.nextLine(); String str=s.nex...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
6c3e493b77a0387d218ee9e1e4fd4fec
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { Reader.init(System.in); int n=Reader.nextInt(); String x=Reader.next(); StringBuilder out=new StringBuilder(); out.append(x.charAt(0)); for (int i = 1; ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
53040f755e86df2a6f769467f429df70
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.Scanner; public class program { public static void main(String[] args) { Scanner scan= new Scanner(System.in); int n=scan.nextInt(); String str = scan.next(); if (n%2!=0) { for (int i = n-2; i >0; i-=2) { System.out.p...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
0f199c40968deccdeabeab4a2a8742c4
train_001.jsonl
1482057300
Polycarp is mad about coding, that is why he writes Sveta encoded messages. He calls the median letter in a word the letter which is in the middle of the word. If the word's length is even, the median letter is the left of the two middle letters. In the following examples, the median letter is highlighted: contest, inf...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class Main { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while ...
Java
["5\nlogva", "2\nno", "4\nabba"]
1 second
["volga", "no", "baba"]
NoteIn the first example Polycarp encoded the word volga. At first, he wrote down the letter l from the position 3, after that his word looked like voga. After that Polycarp wrote down the letter o from the position 2, his word became vga. Then Polycarp wrote down the letter g which was at the second position, the word...
Java 11
standard input
[ "implementation", "strings" ]
2a414730d1bc7eef50bdb631ea966366
The first line contains a positive integer n (1 ≤ n ≤ 2000) — the length of the encoded word. The second line contains the string s of length n consisting of lowercase English letters — the encoding.
900
Print the word that Polycarp encoded.
standard output
PASSED
fd38daf3a7526747314260de9ffb92bb
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Scanner; import java.util.StringTokenizer; /** * Created with IntelliJ IDEA. * User: AUtemuratov * Date: 07.04.14 * Time: 15:43 * To change this template use File | Settings | ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
d9fe65433addae6fb01b892eaf20a7e5
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Scanner; import java.util.StringTokenizer; /** * Created with IntelliJ IDEA. * User: AUtemuratov * Date: 07.04.14 * Time: 15:43 * To change this template use File | Settings | ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
55ea95fb84df5c87f1f5eade15fde33b
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Main { static BufferedReader reader; static StringTokenizer tokenizer; static PrintWriter writer; static int nextInt() throws IOException ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
3fbd14ab052274c5744826e028759601
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { Reader.init(System.in); int n = Reader.nextInt() ; StringBuilder s = new StringBuilder () ; boolean is = true ; if (n%2==0) { System.out.println((...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
2bb22d52e7c27c9e2a2b168cc1a7766d
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.*; public class A { public static void main(String[]args)throws IOException { DataInputStream N=new DataInputStream(System.in); int n=Integer.parseInt(N.readLine()); int h=n/2;; if(n%2==0)System.out.println(n*n/2); else { System.out.println((h+1)*(h+1)+h*h); } int flag=1; for(i...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
78ff9f0b879b0d70b69dd7f106ec5819
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.*; public class codetest { public static void main(String[] args) { Scanner input = new Scanner(System.in); int n = input.nextInt(); int answer = (int)Math.pow(n,2) / 2 + n % 2; System.out.println(answer); String outl...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
4260a6d23dc5b7ebc36b9b0feaab4d1d
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); System.out.println(n % 2 == 0 ? n * n / 2 : n * n / 2 + 1); StringBuilder s0 = new StringBuilder(); StringBuilder s1 = new StringBuilder(); for (int ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
b26b86107404b177ade1fb5e07add2be
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.*; public class Problem384A { StreamTokenizer in; PrintWriter out; public static void main( String[] args) throws IOException { new Problem384A().run(); } public int nextInt() throws IOException { in.nextToken(); return (int)in.nval; } void run() thro...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
92acd71987af88088214cfbbc28eccb0
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Codeforces { public static void main(String[] args) { CustomInputReader in = new CustomInputReader(System.in); ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
0ebca4fb09124e97b5ff4e7db47f7508
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.util.Arrays; import java.util.StringTokenizer; public class Codeforces { public static void main(String[] args) { CustomInputReader in = new CustomInputReader(System.in); ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
02e9103fd4e61af2c62558df250b4d70
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if(n==1) { System.out.println(1); System.out.println("C");return; } if(n==2) { ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
c5917f7fc2f5877bc3b0de42ffef6be1
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class CF384A { public static void main(String[] args) throws Exception { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); for(String ln;(ln=in.readLine())!=null;){ int N = Integer.parseInt(ln); char[][] m = ne...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
05b2018c25c24c08354f2e97da5bddca
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
//package javaapplication1; import java.io.*; import java.util.*; public class JavaApplication1 implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer tok = new StringTokenizer(""); final boolean OJ = System.getProperty("ONLINE_JUDGE") != null; void init() throws FileNotFoun...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
91b1dd94b46c66b18a80624e0e46d795
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class A { static Scanner sc=new Scanner(System.in); public static void main(String[] args) { int n=sc.nextInt(); if(n%2==0) System.out.println(n*n/2); else System.out.println((n*n+1)/2); if (n>=2) { String a="",b=""; for (int i = 0; i < n; i++) if(i%2==0...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
d67f683964119bbd79899f6b39ec569f
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; 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()); Sy...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
66e173e7473f42fd96eaeccaa3ffb3ed
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) { Scanner t =new Scanner(System.in); int n=t.nextInt(); StringBuilder b1=new StringBuilder(); StringBuilder b2=new ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
7e4da779031167cf63cb5598337408d7
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.*; public class Code { public static void main(String[] args) { Scanner in = new Scanner(System.in); int a = in.nextInt(); int con = 0; ArrayList<String> r = new ArrayList(); for (int i = 1; i <= a; i++) { if (i % 2 != 0) { for (...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
bf45fa711f546a0249063f738d4eeb2c
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.*; /** * 384A: Coder */ public class Main { public static void main (String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int total; char test = 'C'; total = Integer.parseInt(br.readLine()); if(tota...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
4354f93509da27795cf9cb7ee225a0ed
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class MainChess { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line = ""; StringBuilder out = n...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
1436d2fc6ba968f75e24964e7112e500
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Arrays; import java.util.Scanner; /* Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y),...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
086d92d1e66dc9325b473c3feacad86b
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class Task384A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.close(); StringBuilder sb = new StringBuilder(); boolean f = true; for (int i = 0; i < n; i++) { if (f) { for (int j = 0; j < n; j++) { ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
1ac8ebbe70184849e97d403f6df7c2e9
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.lang.*; import java.io.*; import java.util.*; public class Coder { public static void main(String[] args) throws java.lang.Exception { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); PrintWriter out = new PrintWriter(ou...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
3e606673c49bbe478c1c756317648e3f
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class Library { static int[] di = { 0, -1, 0, 1 }; static int[] dj = { -1, 0, 1, 0 }; static int[] di_knight = { -1, -1, -2, -2, 1, 1, 2, 2 }; static int[] dj_knight = { 2, -2, -1, 1, 2, -2, -1, 1 }; static BufferedReader br ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
89bfbd882113bbaa7023afa8a120ab91
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class Library { static int[] di = { 0, -1, 0, 1 }; static int[] dj = { -1, 0, 1, 0 }; static int[] di_knight = { -1, -1, -2, -2, 1, 1, 2, 2 }; static int[] dj_knight = { 2, -2, -1, 1, 2, -2, -1, 1 }; static BufferedReader br = new BufferedR...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
f54e98b9b24909da56f1d65e7f933dab
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; p...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
07a413c4a388cd4693ee8d4b687c1655
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.*; import java.util.*; public class CF225A { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); StringTokenizer stringTokenizer; String next() throws IOException{ while(stringTokenizer == null || !stringTokenizer.has...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
5bc11381485b7705763a0f3b7cb13232
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.io.*; import java.util.*; public class CF225A { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); PrintWriter pw = new PrintWriter(System.out); StringTokenizer stringTokenizer; String next() throws IOException{ while(stringTokenizer == null || !stringTokenizer.has...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
f2c4fe209861097b9332443f0c7bd0aa
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); StringBuffer ss=new StringBuffer(""); int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss.append("C."); } System.out.println(c); int i=0; boolean b=true; whi...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
fca745203ed2c956f9a789ae1431e4e4
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees{ public static void main(String[] args){ Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C.";} System.out.println(c); int i=0; boolean b=true; String s1=ss.substring(0,0+x)+"\n"; S...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
a47e06362fb5c5a6d7af2d7a140be78d
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees{ public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C.";} System.out.println(c); int i=0; boolean b=true; String s1=ss.substring(0,0+x)+"\n"; ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
ad88f33ee05a8f3ddb8b29e678566e09
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); StringBuilder s=new StringBuilder(""); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C."; } System.out.println(c); int i=0; boolean b=t...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
7578bead1ef99d8dc0ece1a795a0f6d4
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss="C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
4781b5812b48427b66f4fbfeb7d4b3db
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C."; } System.out.println(c); int i=0; boolean b=true; String s1=ss.substring(0,0+x)+"\n"...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
c77eb92788d6f94c618fae0c7ff4b79b
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C."; } System.out.println(c); int i=0; boolean b=true; while(++i<=x) { if(b) System.out....
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
869d17f8208b386c46a071a073d98125
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees{ public static void main(String[] args){ Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C.";} System.out.println(c); int i=0; boolean b=true; String s1=ss.substring(0,0+x)+"\n"; S...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
fc07b17ed8673af8dad4717da14c2607
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; for(int i=0;ss.length()<=x;i++){ ss+="C."; } System.out.println(c); int i=0; boolean b=true; while(++i<=x) { if(b) {...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
1f2df3d89cb6b3b8af04fa4b9312507f
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C.";} System.out.println(c); int i=0; boolean b=true; String s1=ss.substring(0,0+x)+"\n";...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
4867c7136b27dd0b6f5352301bd5b7f4
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss="C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C.C...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
91a194fd7c5d3c639256ee6f01f58c98
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; ///////// if(c%2==0) c=c/2; else c=(c/2)+1; //////// while(ss.length()<=x){ ss+="C."; } ///// System.out.println(c); int i=0; boolean b=true; String s1...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
51ee009352af33362ab842b5d346d5cd
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class chees { public static void main(String[] args) { Scanner in =new Scanner(System.in); String ss=""; int x=in.nextInt(); int c=x*x; if(c%2==0) c=c/2; else c=(c/2)+1; while(ss.length()<=x){ ss+="C.";} System.out.println(c); int i=0; boolean b=true; String s1=ss.substring(0,0+x)+"\n";...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
0f2e657a8fb4cb0b65b4c70da0b73cf6
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { Scanner in = new Scanner(System.in); int N = in.nextInt(); System.out.println((N*N+1)/2); StringBuilder sb = new StringBuilder(); for (int r=0; r<N; r++) { ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
37d9a72005a81c03bcb88426b43c736d
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author KHALED */ public class Coder { public static void main(String[] args) { Scan...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
06a414a7013b56a87f9c4472d847b4cf
train_001.jsonl
1390231800
Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x, y), he can move to (or attack) positions (x + 1, y), (x–1, y), (x, y + 1) and (x, y–1).Iahub wants to know how many Co...
256 megabytes
import java.util.Scanner; public class A { public static void main(String[] args) { int n = (new Scanner(System.in)).nextInt(); int a = (n + 1) / 2; int b = n / 2; int r = a * a + b * b; System.out.println(r); String s = ""; for (int i = 0; i <= n; i++) { ...
Java
["2"]
1 second
["2\nC.\n.C"]
null
Java 7
standard input
[ "implementation" ]
1aede54b41d6fad3e74f24a6592198eb
The first line contains an integer n (1 ≤ n ≤ 1000).
800
On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any.
standard output
PASSED
f3962dcafae056afad267332b9620aef
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.PrintStream; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHel...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
b6e2a85635e32cb3dd4d659279b89c98
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; import static java.lang.Math.max; import static java.lang.Math.min; public class ProblemF { static class FastScanner { private BufferedReader reader; private StringTokeni...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
88d4395c5d6481e678b39aee58b0c5a1
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; import java.math.*; public class F { public static int mod = 1000000007; public static void main(String[] args) throws Exception { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); // Scanner scan = new Scanner(Sys...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
dea973b32a72d14dfa304563712730ec
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
/** * @author derrick20 * Soooo hard but finally figured it out. */ import java.io.*; import java.util.*; /* Equal: 500000005 P1^2 - P2: 125000002 Indep: 0 Dep: 1 */ public class ExpectedSquareBeauty { public static void main(String args[]) throws Exception { FastScanner sc = new FastScanner(); ...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
b952ddaca956d631b90b54a317c64902
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.*; import java.util.*; public class Codeforces1187F { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); st = ne...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
b8683029d7fbb1fed3220e900fc5e2c4
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; import java.io.UncheckedIOException; import java.io.Closeable; import java.io.Writer; import java.io.OutputStreamWriter; import java.io.InputStream; /** * Built using CHelper p...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
15da8edc92ef5d727f0256e1e2b00d82
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.util.*; import java.io.*; public class EdD { static long[] mods = {1000000007, 998244353, 1000000009}; static long mod = mods[0]; public static MyScanner sc; public static PrintWriter out; public static void main(String[] omkar) throws Exception{ // TODO Auto-generated method stub sc = new MySc...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
5c3a8f365f3298e3dc28e288efffc31f
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.math.BigInteger; import java.util.Scanner; public class ExpectedSquareBeauty { static final long MOD = 1000000007; static final BigInteger BIG_MOD = BigInteger.valueOf(MOD); public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); ...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
edd2645717c839d7393446fb87cac421
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStrea...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
a9d49e90c9262eab9efe0cb03b8b8cdf
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.InputStream; /** * Built using CHel...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
42be3c15b6b087680de04e29262ff357
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.InputStream;...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
8ed3071628cba322b4b89b993c3de25a
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; import java.io.BufferedReader; import java.io.InputStream; /** * Built using CHel...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
44660597ec2990e568978ed9cc2affc2
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; import java.util.stream.IntStream; public class F { static long mod = 1000000000L + 7; class Frac{ long a,b; Frac(long a, long b){ this.a = a%mod; this.b = b%mod; } Frac(long a){ this.a = a%mod; this.b = 1; } Frac add(Frac x...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
cb20362150fb170446fe37f525e71dfa
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
//package educational.round67; 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 F2 { InputStream is; PrintWriter out; String INPUT = ""; public static int[] uniq(...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
7ba376faf0c994f04e77d834ff9d6001
train_001.jsonl
1561905900
Let $$$x$$$ be an array of integers $$$x = [x_1, x_2, \dots, x_n]$$$. Let's define $$$B(x)$$$ as a minimal size of a partition of $$$x$$$ into subsegments such that all elements in each subsegment are equal. For example, $$$B([3, 3, 6, 1, 6, 6, 6]) = 4$$$ using next partition: $$$[3, 3\ |\ 6\ |\ 1\ |\ 6, 6, 6]$$$.Now y...
256 megabytes
// package ContestEd67; import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; public class mainF { public static PrintWriter out = new PrintWriter(System.out); public static FastScanner enter = new FastScanner(System.in); public static long mod = (long) 1e9 + 7; public static ...
Java
["3\n1 1 1\n1 2 3", "3\n3 4 5\n4 5 6"]
2 seconds
["166666673", "500000010"]
NoteLet's describe all possible values of $$$x$$$ for the first sample: $$$[1, 1, 1]$$$: $$$B(x) = 1$$$, $$$B^2(x) = 1$$$; $$$[1, 1, 2]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 1, 3]$$$: $$$B(x) = 2$$$, $$$B^2(x) = 4$$$; $$$[1, 2, 1]$$$: $$$B(x) = 3$$$, $$$B^2(x) = 9$$$; $$$[1, 2, 2]$$$: $$$B(x) = 2$$$, $$$B^...
Java 8
standard input
[ "dp", "probabilities", "math" ]
1d01c01bec67572f9c1827ffabcc9793
The first line contains the single integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the size of the array $$$x$$$. The second line contains $$$n$$$ integers $$$l_1, l_2, \dots, l_n$$$ ($$$1 \le l_i \le 10^9$$$). The third line contains $$$n$$$ integers $$$r_1, r_2, \dots, r_n$$$ ($$$l_i \le r_i \le 10^9$$$).
2,500
Print the single integer — $$$E((B(x))^2)$$$ as $$$P \cdot Q^{-1} \mod 10^9 + 7$$$.
standard output
PASSED
57bca18ef90dc823a75421b40e471f66
train_001.jsonl
1276875000
You are given an equation: Ax2 + Bx + C = 0. Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
256 megabytes
import java.io.*; import java.util.*; public class p20b { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double A = sc.nextDouble(); double B = sc.nextDouble(); double C = sc.nextDouble(); if(A==0 && B==0 & C==0) System.out.println("-1"); ...
Java
["1 -5 6"]
1 second
["2\n2.0000000000\n3.0000000000"]
null
Java 7
standard input
[ "math" ]
84372885f2263004b74ae753a2f358ac
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
2,000
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
standard output
PASSED
a175ec251095775262fc5e7c3591c4e5
train_001.jsonl
1276875000
You are given an equation: Ax2 + Bx + C = 0. Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
256 megabytes
import java.util.Scanner; public class b { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double a = sc.nextDouble(), b = sc.nextDouble(), c = sc.nextDouble(); sc.close(); if (a == 0 && b == 0 && c == 0) { System.out.println("-1"); return; } if (a...
Java
["1 -5 6"]
1 second
["2\n2.0000000000\n3.0000000000"]
null
Java 7
standard input
[ "math" ]
84372885f2263004b74ae753a2f358ac
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
2,000
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
standard output
PASSED
a78ff54f1dd1caa2496891c8a51cd973
train_001.jsonl
1276875000
You are given an equation: Ax2 + Bx + C = 0. Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
256 megabytes
import java.util.Scanner; public class problem20B { public static void main(String[] args) { Scanner scan = new Scanner(System.in); double A = (double) (scan.nextInt()); double B = (double) (scan.nextInt()); double C = (double) (scan.nextInt()); scan.close(); ...
Java
["1 -5 6"]
1 second
["2\n2.0000000000\n3.0000000000"]
null
Java 7
standard input
[ "math" ]
84372885f2263004b74ae753a2f358ac
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
2,000
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
standard output
PASSED
af57102606a3e16a775f7ec60d559f26
train_001.jsonl
1276875000
You are given an equation: Ax2 + Bx + C = 0. Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
256 megabytes
import java.util.Scanner; public class CF_020B { public static void main(String[] args) { Scanner read = new Scanner(System.in); long a = read.nextInt(); long b = read.nextInt(); long c = read.nextInt(); long d = b * b - 4 * a * c; if (a == 0) { if (b == 0 && c == 0) System.out.println(-1); el...
Java
["1 -5 6"]
1 second
["2\n2.0000000000\n3.0000000000"]
null
Java 7
standard input
[ "math" ]
84372885f2263004b74ae753a2f358ac
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
2,000
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
standard output
PASSED
fc4eba203eb058794e41826208a71aa2
train_001.jsonl
1276875000
You are given an equation: Ax2 + Bx + C = 0. Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
256 megabytes
import java.io.*; import java.util.*; public class equation { static BufferedReader br; static StringTokenizer st; static PrintWriter out; public static boolean isquadratic(int a, int b, int c) { if (a != 0) return true; return false; } public static long determinant(int a, int b, int c) { return (long...
Java
["1 -5 6"]
1 second
["2\n2.0000000000\n3.0000000000"]
null
Java 7
standard input
[ "math" ]
84372885f2263004b74ae753a2f358ac
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
2,000
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
standard output
PASSED
641ed0969f6fa886de36301f4c24f990
train_001.jsonl
1276875000
You are given an equation: Ax2 + Bx + C = 0. Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
256 megabytes
import java.io.*; import java.util.Arrays; import java.util.StringTokenizer; /** * Created by peacefrog on 11/24/15. * Time : 7:54 PM */ public class CF20B { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; PrintWriter out; long timeBegin, timeEnd; public void runIO() throws IOExceptio...
Java
["1 -5 6"]
1 second
["2\n2.0000000000\n3.0000000000"]
null
Java 7
standard input
[ "math" ]
84372885f2263004b74ae753a2f358ac
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
2,000
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
standard output
PASSED
311428f5104a383c720a3bca2873d5ea
train_001.jsonl
1276875000
You are given an equation: Ax2 + Bx + C = 0. Your task is to find the number of distinct roots of the equation and print all of them in ascending order.
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; import java.math.BigInteger; import java.util.ArrayList; import java.util.Arrays; import java.util.Collectio...
Java
["1 -5 6"]
1 second
["2\n2.0000000000\n3.0000000000"]
null
Java 7
standard input
[ "math" ]
84372885f2263004b74ae753a2f358ac
The first line contains three integer numbers A, B and C ( - 105 ≤ A, B, C ≤ 105). Any coefficient may be equal to 0.
2,000
In case of infinite root count print the only integer -1. In case of no roots print the only integer 0. In other cases print the number of root on the first line and the roots on the following lines in the ascending order. Print roots with at least 5 digits after the decimal point.
standard output