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 | b457bb1e47ea35252f8df44434ce337c | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;
public class cf275c {
static BufferedReader br;
static Scanner sc;
static PrintWriter out;
public static void ini... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | aa43b7b6be6307f42d00a8e74a3ce020 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;
public class cf275c {
static BufferedReader br;
static Scanner sc;
static PrintWriter out;
public static void ini... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | f1bff3659d9452a601970e1c452e3f2d | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | /*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
import java.io.*;
import java.math.BigInteger;
import java.util.*;
import java.text.*;
public class cf275c {
static BufferedReader br;
static Scanner sc;
static PrintWriter out;
public static void ini... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | c039570853d01abadcfa681aa61a7cb8 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Scanner;
import java.util.Set;
public class b {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
Set<Long> vals = new HashSet<... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | add31629dd50dd77962cd8b99ad61f2e | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class b {
public static void main(String[] args) thro... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | cdfc266bf3192efe3ba43f4d33360471 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class b {
public static void main(String[] args) throws Exception {
// S... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | 7a1dc7b69021e1f3be3df6f73923b485 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.StringTokenizer;
public class b {
public static void main2(String[] args) {
... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | a87625c1cfc6c1fc5541bdd307942d37 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | c8880358fd000b95b6b8f2543efd38c4 | train_002.jsonl | 1361374200 | A k-multiple free set is a set of integers where there is no pair of integers where one is equal to another integer multiplied by k. That is, there are no two integers x and y (xβ<βy) from the set, such that yβ=βxΒ·k.You're given a set of n distinct positive integers. Your task is to find the size of it's largest k-m... | 256 megabytes | import java.io.IOException;
import java.io.InputStreamReader;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Random;
public class C275C {
static StreamTokenizer in;
static int nextInt() throws IOException{
in.nextToken();
return (int) in.nva... | Java | ["6 2\n2 3 6 5 4 10"] | 2 seconds | ["3"] | NoteIn the sample input one of the possible maximum 2-multiple free subsets is {4, 5, 6}. | Java 6 | standard input | [
"binary search",
"sortings",
"greedy"
] | 4ea1de740aa131cae632c612e1d582ed | The first line of the input contains two integers n and k (1ββ€βnββ€β105,β1ββ€βkββ€β109). The next line contains a list of n distinct positive integers a1,βa2,β...,βan (1ββ€βaiββ€β109). All the numbers in the lines are separated by single spaces. | 1,500 | On the only line of the output print the size of the largest k-multiple free subset of {a1,βa2,β...,βan}. | standard output | |
PASSED | c41d6f2d74636e01f0dbcfad5a0e46d3 | train_002.jsonl | 1276182000 | In an English class Nick had nothing to do at all, and remembered about wonderful strings called palindromes. We should remind you that a string is called a palindrome if it can be read the same way both from left to right and from right to left. Here are examples of such strings: Β«eyeΒ», Β«popΒ», Β«levelΒ», Β«abaΒ», Β«deedΒ», ... | 128 megabytes | import java.io.*;
//import java.util.*;
import java.math.BigInteger;
public class Main {
static long mod = 51123987;
static int[] findPal(String str, int offset){
int N = str.length(), L = -1, R = -1;
int[] res = new int[N - offset];
for(int i = 0; i < N - offset; i++){
if(i < R){
res[i] = Math.m... | Java | ["4\nbabb", "2\naa"] | 2 seconds | ["6", "2"] | null | Java 7 | standard input | [
"strings"
] | 1322a0f1c38f8de56f840fc7e2f14a54 | The first input line contains integer n (1ββ€βnββ€β2Β·106) β length of the text. The following line contains n lower-case Latin letters (from a to z). | 2,900 | In the only line output the amount of different pairs of two subpalindromes that cross each other. Output the answer modulo 51123987. | standard output | |
PASSED | 177a9b95362441e42a4283b69cca2317 | train_002.jsonl | 1276182000 | In an English class Nick had nothing to do at all, and remembered about wonderful strings called palindromes. We should remind you that a string is called a palindrome if it can be read the same way both from left to right and from right to left. Here are examples of such strings: Β«eyeΒ», Β«popΒ», Β«levelΒ», Β«abaΒ», Β«deedΒ», ... | 128 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;
public class E {
static BufferedReader br = new BufferedReader(new InputStreamReader(
System.in));
static StringTokenizer st = new StringTokenizer("");
static int nex... | Java | ["4\nbabb", "2\naa"] | 2 seconds | ["6", "2"] | null | Java 7 | standard input | [
"strings"
] | 1322a0f1c38f8de56f840fc7e2f14a54 | The first input line contains integer n (1ββ€βnββ€β2Β·106) β length of the text. The following line contains n lower-case Latin letters (from a to z). | 2,900 | In the only line output the amount of different pairs of two subpalindromes that cross each other. Output the answer modulo 51123987. | standard output | |
PASSED | 3ba3d32981ed3bae2423d7982de6a707 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | //package MyPackage.YourPack.kfjf;
import java.util.Scanner;
public class ComplexNotBoringMfldfdd {
public static void main(String []args){
Scanner scan=new Scanner(System.in);
String fk=scan.next();
String sk=scan.next();
String text=scan.next();
for(int i=0;i<text.len... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 65b53419255cd3421987b7d015578cf4 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | //Author: Mo Abjal, MJP Rohilkhand University Bareilly, UP, India 2018.
///////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////********************//////////////////////////////////////////////
////////////////////////////////... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 5edc561147199d58c045797cdfd8d134 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class firstProb {
private static Scanner s;
public static void main(String[] args){
s = new Scanner(System.in);
Map<String,Integer> key1=new HashMap<String,Integer>();
M... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 3969a489ee68677b665eeac27b9aad44 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
public class firstProb {
private static Scanner s;
public static void main(String[] args){
s = new Scanner(System.in);
Map<String,Integer> key1=new HashMap<String,Integer>();
M... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 6b5c54cf670ee500b62e0fdf94562bb1 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class Keyboard_Layouts {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String type1 = scan.nextLine();
String type2 = scan.nextLine();
String s = scan.nextLine();
char [] S = s.toCharArray();
String re... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 413b7185e0cc932eca1aa8f62ac8d773 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes |
import java.util.Scanner;
public class stick {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc=new Scanner(System.in);
String lay1 = sc.next();
String lay2 = sc.next();
String word1 = sc.next();
String word2 = new String();
int i=0,j=0;
char c;
for(i=0;i... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 68cfd1d32f602a4f5e17df70041e27e5 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
static class Reader
{
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
din = new DataIn... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | fffb541ab7cd502a4adfbb9f99ef3171 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.HashMap;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author newkobra
*/
public class Main {
public static void main(String[] arg... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 13360ae03cb04732d72f5df7793ac8ab | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.*;
public class KeyboardLayout {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
String a = s.next();
String b = s.next();
String para = s.next();
HashMap<Character, Character> map = Getlayout(a, b);
String res = "";
Stri... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 85fe61011897a5a6b45b4e2eb0dde004 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.lang.String;
import java.util.Scanner;
import java.lang.Character;
public class TaskA{
public static void main(String args[]){
Scanner s = new Scanner(System.in);
String keyboard = s.next();
String reference = s.next();
String msg = s.next();
char msgformatedChars[] =new char[msg.length()];
fo... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | e8388ab57833b637f2f46fa22925a2de | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class main {
public static void main(String[] args){
String l1,l2,word;
Scanner s = new Scanner(System.in);
l1 = s.next();
l2 = s.next();
word = s.next();
/*cin >> l1 >> l2 >> word;*/
/*l1 = "qwertyuiopasdfghjklzxcvbnm";
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | d31bb1e5a59544c3cdc314d814ea09bf | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class main {
public static void main(String[] args){
String l1,l2,word;
Scanner s = new Scanner(System.in);
l1 = s.next();
l2 = s.next();
word = s.next();
/*cin >> l1 >> l2 >> word;*/
/*l1 = "qwertyuiopasdfghjklzxcvbnm";
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | df8b02044cecdee6ac08f1023b57de7b | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class main {
public static void main(String[] args){
String l1,l2,word;
Scanner s = new Scanner(System.in);
l1 = s.next();
l2 = s.next();
word = s.next();
/*cin >> l1 >> l2 >> word;*/
/*l1 = "qwertyuiopasdfghjklzxcvbnm";
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | b9b703cc4fd6ba1cd2991b0fd3112a7b | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class KeyboardLayouts {
public static void main(String[] args){
String l1,l2,word;
Scanner s = new Scanner(System.in);
l1 = s.next();
l2 = s.next();
word = s.next();
/*cin >> l1 >> l2 >> word;*/
/*l1 = "qwertyuiopasdfghjklzxc... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 3ad8ee772d938ec7508dc974087d1f72 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class main {
public static void main(String[] args){
String l1,l2,word;
Scanner s = new Scanner(System.in);
l1 = s.next();
l2 = s.next();
word = s.next();
/*cin >> l1 >> l2 >> word;*/
/*l1 = "qwertyuiopasdfghjklzxcvbnm";
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 406724358277312e4be50fd3d4a80f3b | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class main {
public static void main(String[] args){
String l1,l2,word;
Scanner s = new Scanner(System.in);
l1 = s.next();
l2 = s.next();
word = s.next();
/*cin >> l1 >> l2 >> word;*/
/*l1 = "qwertyuiopasdfghjklzxcvbnm";
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 1153ce0c9e9fe1a3809a4747f8e0a91f | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class KeyboardLayouts {
public static void main(String[] args) {
Scanner in= new Scanner(System.in);
String s1 = in.nextLine();
s1=s1.toLowerCase();
String s2 = in.nextLine();
s2=s2.toLowerCase();
String testNotChanged = in.nextLine();
String test=testNotChanged.toLowerCase();
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 14e309adb6b79faaf5e84281131cbe87 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class KeyboardLayouts {
public static void main(String[] args) {
Scanner in= new Scanner(System.in);
String s1 = in.nextLine();
s1=s1.toLowerCase();
String s2 = in.nextLine();
s2=s2.toLowerCase();
String testNotChanged = in.nextLine();
String test=testNotChanged.toLowerCase();
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 999a9bb834ee0ec0b1998c2ca8d5561c | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.*;
import java.util.*;
public class A764 {
public static void main(String [] args) {
InputStream inputReader = System.in;
OutputStream outputReader = System.out;
InputReader in = new InputReader(inputReader);
PrintWriter out = new PrintWriter(outputReader);
Al... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | f014878570d55f88dfbe4f8034ebdb78 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.*;
import java.util.*;
public class A764 {
public static void main(String [] args) {
InputStream inputReader = System.in;
OutputStream outputReader = System.out;
InputReader in = new InputReader(inputReader);
PrintWriter out = new PrintWriter(outputReader);
Al... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 93e8b88f8248fa2f2d02b5c5d642e85a | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
//PLEASE HACK MY SOLUTION IT IS EASY TO UNDERSTAND
public static void main(String[] args) {
StdIn in = new StdIn();
String original=in.next();
String after=in.next();
String toTransform=in.next();
char[] transforms = new char[26];
for(int i=0; ... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 5d776079c9fe8bfffde80e06c43aebb4 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
/**
*
* @author APELTOP
*/
p... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | e1b3f17bc79e331d76fa9a9551241c9f | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes |
import java.util.Scanner;
public class prob1 {
public String read (String firstLayout,String secLayout ,String txtLayout ) {
String ans = new String();
for (int i = 0 ; i<txtLayout.length();i++) {
for (int j =0;j<firstLayout.length() && Character.isLetter(txtLayout.charAt(i));j++) {
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 639aef86e3d6af7103609784461c8512 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.LinkedList;
import java.util.Scanner;
public class KeyboardLayouts {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
char[] w = new char[26];
String key1 = s.nextLine();
String key2 = s.nextLine();
String word = s.nextLine();
for (int i = 0; i < 26; i++) {
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | a0ccd35e4fd191fe16cb79cd14137e90 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.LinkedList;
import java.util.Scanner;
public class KeyboardLayouts {
public static void main(String[] args) {
Scanner s = new Scanner(System.in);
char[] w = new char[26];
String key1 = s.nextLine();
String key2 = s.nextLine();
String word = s.nextLine();
for (int i = 0; i < 26; i++) {
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 4b04a6198f34d3c493710eed7b4baac1 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class test
{
public static void main(String [] args){
// int n=0;
// int m=0;
// Scanner scanner = new Scanner(System.in);
// n=scanner.nextInt();
// m=scanner.nextInt();
// int smallest=0;
// if (n>m){
// smallest=m;
// ... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 6c42f0f47c197fd30a31ab0ce5e1c6b8 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class keyboardLayout {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String x, y, z;
x = scan.nextLine();
y = scan.nextLine();
z = scan.nextLine();
for (int i = 0; i < z.length(); i++) {
for (int j = 0; j < x.length(); j++)... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | e1ce2c7db9e1cd8a74e457d9583f52eb | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class keyboardLayout {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
String x, y, z;
x = scan.nextLine();
y = scan.nextLine();
z = scan.nextLine();
for (int i = 0; i < z.length(); i++) {
for (int j = 0; j < x.length(); j++) {... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | ec07000d18dbb3b09059e448f1f4b7a5 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Scanner;
/**
*
* @author KCc
*/
public class ACM2 {
/**
* @param args the command line arguments
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 02652f4072f8287e9af059011d762dfc | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Scanner;
/**
*
* @author KCc
*/
public class ACM2 {
/**
* @param args the command line arguments
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | d037752f82a7aacef29aa293fbc0d6fd | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.util.Scanner;
/**
*
* @author KCc
*/
public class ACM2 {
/**
* @param args the command line arguments
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | f8e5de84cf67c4f690d9de14b89fb76a | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class BKeyboardLayouts {
public static String result(String first, String second, String third){
char[] t = third.toCharArray();
String word = "";
char c;
boolean isUpper = false;
for(int i = 0; i < t.length; i++){
if(Character.... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 3497c851daeda2dc3643cf99794422c0 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class BKeyboardLayouts {
public static String result(String first, String second, String third){
char[] t = third.toCharArray();
String word = "";
char c;
boolean isUpper = false;
for(int i = 0; i < t.length; i++){
if(Character.i... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 6662b17bb3d1cdd47f925ac8c4475143 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
/**
*
* @author myoun
*/
public class ProblemSolver {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner input=new Scanner(System.in);
String first,second,result;
... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 2858c59866094d5215995ccbe4b13f9a | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.*;
import java.lang.String;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
char[] ch1=sc.next().toCharArray();
char[] ch2=sc.next().toCharArray();
char[] ch3=sc.next().toCharArray();
char[] ch4=new char[ch3.length];
int k=0;
for(int i=0... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 0aeb1b12509475b056c852fedacbde7f | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.*;
import java.lang.annotation.*;
public class Main
{
public static void main(String[] args)
{
String s1,s2,s3,s4="";
Scanner in = new Scanner(System.in);
s1 = in.nextLine();
s2 = in.nextLine();
s3 = in.nextLine();
if(s1.isEmpty() || s2.isEmpty() || s3.isEmpty())System.exit(0);
char tem... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | b10c8d4f7ecf4a2e7efcab039001c14b | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.math.*;
public class Competitive_1 {
public static void main(String[] args) {
FastReader in = new FastReader();
String l1=in.next(), l2=in.next();
HashMap<Character, Character> map ... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 938829abee8fc1c1b18c6deb971d7486 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class KeyboardLayouts {
public static void main(String[] args) {
Scanner cin=new Scanner(System.in);
String s1=cin.next();
String s2=cin.next();
String s3=cin.next();
int num;
for(int i=0;i<s3.length();i++) {
num=s1.indexOf(s3.charAt(i));
if(Character.isDigit(s3.charAt(i))) {... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 5b007fc8d4e8743c518ab1538bd938aa | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.HashMap;
import java.util.Scanner;
public class prob2 {
public static void main(String []args){
Scanner s = new Scanner(System.in);
String first = s.nextLine();
String second = s.nextLine();
String input = s.nextLine();
char [] firstArr = new char[26];
char [] secondArr = new char[... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 6681d2277958d36a5caf82433da52781 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.HashMap;
import java.util.Scanner;
public class prob2 {
public static void main(String []args){
Scanner s = new Scanner(System.in);
String first = s.nextLine();
String second = s.nextLine();
String input = s.nextLine();
char [] firstArr = new char[26];
char [] secondArr = new char[... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 13f8b48d92135dba52fc6c8aa2a18f78 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class TestCodeForcesPractise {
public static void main(String[] args) {
// System.out.println((char) (+('9' - 'a') + 'A'));
Scanner sc = new Scanner(System.in);
String a = sc.next();
sc.nextLine();
String b = sc.next();
char[] A = ... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | b7fa69749752236e3adee204d520f5ba | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Map;
import java.util.Scanner;
import java.util.HashMap;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] arg... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 900ba922fdb6e8ae7e3fd10acd78c696 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class problemb {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
String s1 = scan.nextLine();
String s2 = scan.nextLine();
boolean b1= false;
String p="";
for(int i=0;i<s2.... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 3273c9c94c05f488b1bb437970df01ff | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class problemb {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
String s1 = scan.nextLine();
String s2 = scan.nextLine();
boolean b1= false;
String p="";
for(int i=0;i<s2.... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 575ad11c71b688b6a92b12fa99cb1b0c | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes |
import java.util.HashMap;
import java.util.Scanner;
/**
*
* @author arabtech
*/
public class Bletter {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String k1, k2, word, word2 = "";
HashMap<Character, Character> map = new HashMap<Charac... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 674f0c2831063fc7ca2a21492d734cc5 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes |
import java.util.*;
import java.math.*;
import java.io.*;
public class Session1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String f , e , ch ;
f = sc.next();
e = sc.next();
ch = sc.next();
for(int i = 0 ; i < ch.length();... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | ef473e0fb2f1425e5ea5fabffb8bbaea | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;
import java.util.Hashtable;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*/
public class Main {
public static void main(String[] args) {
InputSt... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | fd96f80bf0ebedd90d2d785441958fff | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
import java.util.HashSet;
import java.util.Hashtable;
import java.util.Iterator;
import... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 0bb255b93fff12096f1660adf7b2a3e6 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.*;
import java.io.*;
public class test{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
String s1=sc.next();
String s2=sc.next();
String text=sc.next();
HashMap<Character,Character> hm=new HashMap<Character,Character>();
fo... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | b0cfc1c1a54494fa598584107a97ba6a | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | import java.util.Scanner;
public class keyboardLayouts {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String layout1 = sc.nextLine();
String layout2 = sc.nextLine();
String input = sc.nextLine();
char [] result = new char [input.length()];
boolean [] capitals = new boole... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 8aa1d4a4b586fc55789f8b9877990da7 | train_002.jsonl | 1499958300 | There are two popular keyboard layouts in Berland, they differ only in letters positions. All the other keys are the same. In Berland they use alphabet with 26 letters which coincides with English alphabet.You are given two strings consisting of 26 distinct letters each: all keys of the first and the second layouts in ... | 256 megabytes | /*
* Copyright (c) 2017 SSI Schaefer Noell GmbH
*
* $Id: Solution 6:47 PM $ / $HeadURL: $
*
*/
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
/**
* @author <a href="mailto:ivan.rykov@ssi-schaefer.ru">iva... | Java | ["qwertyuiopasdfghjklzxcvbnm\nveamhjsgqocnrbfxdtwkylupzi\nTwccpQZAvb2017", "mnbvcxzlkjhgfdsapoiuytrewq\nasdfghjklqwertyuiopzxcvbnm\n7abaCABAABAcaba7"] | 1 second | ["HelloVKCup2017", "7uduGUDUUDUgudu7"] | null | Java 8 | standard input | [
"implementation",
"strings"
] | d6f01ece3f251b7aac74bf3fd8231a80 | The first line contains a string of length 26 consisting of distinct lowercase English letters. This is the first layout. The second line contains a string of length 26 consisting of distinct lowercase English letters. This is the second layout. The third line contains a non-empty string s consisting of lowercase and u... | 800 | Print the text if the same keys were pressed in the second layout. | standard output | |
PASSED | 16c7ec20daccbb07299cb784ca6555ef | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes |
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.StringTokenizer;
import java.util.TreeSet;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template f... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | c60ed36759632b749b432c04700174a6 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import java.util.*;
import java.io.*;
public class e {
public static void main(String[] Args)
throws Exception
{
FS sc = new FS(System.in);
int t = sc.nextInt();
while (t-->0) {
int n = sc.nextInt();
Pair[] ps = new Pair[n*2];
int c = 0;
for (int i = 0... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 173dc566a120ccc186c143ed484a0ca0 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import java.io.*;
import java.util.*;
public class E {
FastScanner scanner;
PrintWriter writer;
void solve() throws IOException {
scanner = new FastScanner(System.in);
writer = new PrintWriter(System.out);
int tests = scanner.nextInt();
for (int t = 0; t < tests; t++) {
... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 676533a2c2806fcc26915b5999a470d7 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/*
ΠΡΠΎΠΊΡΠ°ΡΡΠΈΠ½ΠΈΡΡΡ
*/
public class Main {
static FastReader in;
static PrintWriter out;
static Random rand = new Random();
static final int INF = (int) (1e9 + 10);
static final int MOD = (int) (1e9 + ... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 3d6abc1ab2e0fcf35714dcb13a8e83a4 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/*
ΠΡΠΎΠΊΡΠ°ΡΡΠΈΠ½ΠΈΡΡΡ
*/
public class Main {
static FastReader in;
static PrintWriter out;
static Random rand = new Random();
static final int INF = (int) (1e9);
static final int MOD = (int) (1e9 + 7);
... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | c128a853efa6606c1070e1b26f5043ba | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
/*
ΠΡΠΎΠΊΡΠ°ΡΡΠΈΠ½ΠΈΡΡΡ
*/
public class Main {
static FastReader in;
static PrintWriter out;
static Random rand = new Random();
static final int INF = (int) (1e9 + 10);
static final int MOD = (int) (1e9 + ... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 4abeca6cb7451706d1fd24770bafb382 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.util.ArrayList;
import java.util.stream.*;
public class E {
public Object solve () {
int N = sc.nextInt();
int [][] A = sc.nextInts(N);
return solve(N, A);
}
Object solve(int N, int [][] A) {
int H = compre... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 7fadeec06d713733d9367fd01e8e1052 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import static java.lang.Math.*;
import static java.util.Arrays.*;
import java.util.*;
import java.util.ArrayList;
import java.util.stream.*;
public class E {
public Object solve () {
int N = sc.nextInt();
int [][] A = sc.nextInts(N);
int H = compress(A);
SumNode S = new SumNode(2*H);
for (int [] a : A) {... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 343767c5b4022749eec3e736193e5515 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import java.util.*;
import java.io.*;
import java.io.FileWriter;
import java.math.BigInteger;
import java.math.BigDecimal;
// Solution
public class Main
{
public static void main (String[] argv)
{
new Main();
}
boolean test = false;
final int[][] dirs8 = {{0,1}, {0,-1}, {-1,0}, {1,0}, ... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 3fec301b7d7ff7f275144e8e6a783cd5 | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import javax.swing.tree.TreeCellRenderer;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
// written by luchy0120
public class Main {
public static void main(String[] args) throws Exception {
new Main().run();
}
class Pair{
int x;int y;
Pair(int x,int y){this... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | 84cccad45512b307c0ad75054cdc349e | train_002.jsonl | 1578665100 | There are $$$n$$$ segments on a $$$Ox$$$ axis $$$[l_1, r_1]$$$, $$$[l_2, r_2]$$$, ..., $$$[l_n, r_n]$$$. Segment $$$[l, r]$$$ covers all points from $$$l$$$ to $$$r$$$ inclusive, so all $$$x$$$ such that $$$l \le x \le r$$$.Segments can be placed arbitrarily Β β be inside each other, coincide and so on. Segments can deg... | 256 megabytes | import javax.swing.tree.TreeCellRenderer;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
// written by luchy0120
public class Main {
public static void main(String[] args) throws Exception {
new Main().run();
}
class Pair{
int x;int y;
Pair(int x,int y){this... | Java | ["3\n4\n1 4\n2 3\n3 6\n5 7\n3\n5 5\n5 5\n5 5\n6\n3 3\n1 1\n5 5\n1 5\n2 2\n4 4"] | 4 seconds | ["2\n1\n5"] | null | Java 8 | standard input | [
"dp",
"graphs",
"constructive algorithms",
"two pointers",
"sortings",
"data structures",
"trees",
"brute force"
] | 58d7066178839b400b08f39b680da140 | The first line contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$)Β β the number of test cases in the test. Then the descriptions of $$$t$$$ test cases follow. The first of each test case contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot10^5$$$)Β β the number of segments in the given set. Then $$$n$$$ lines foll... | 2,300 | Print $$$t$$$ integers β the answers to the $$$t$$$ given test cases in the order of input. The answer is the maximum number of segments in the union of $$$n-1$$$ segments if you erase any of the given $$$n$$$ segments. | standard output | |
PASSED | fd61d6fac47e605f19aeb42df99174ac | train_002.jsonl | 1430411400 | You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the ice.The level of the cave where you are is a rectangular square grid of n rows and m columns. Each cell consists eit... | 256 megabytes |
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import jav... | Java | ["4 6\nX...XX\n...XX.\n.X..X.\n......\n1 6\n2 2", "5 4\n.X..\n...X\nX.X.\n....\n.XX.\n5 3\n1 1", "4 7\n..X.XX.\n.XX..X.\nX...X..\nX......\n2 2\n1 6"] | 2 seconds | ["YES", "NO", "YES"] | NoteIn the first sample test one possible path is:After the first visit of cell (2,β2) the ice on it cracks and when you step there for the second time, your character falls through the ice as intended. | Java 8 | standard input | [
"dfs and similar"
] | afac59c927522fb223f59c36184229e2 | The first line contains two integers, n and m (1ββ€βn,βmββ€β500)Β β the number of rows and columns in the cave description. Each of the next n lines describes the initial state of the level of the cave, each line consists of m characters "." (that is, intact ice) and "X" (cracked ice). The next line contains two integers,... | 2,000 | If you can reach the destination, print 'YES', otherwise print 'NO'. | standard output | |
PASSED | d80f86a2af2b95d2ca2cac60dd03642d | train_002.jsonl | 1430411400 | You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the ice.The level of the cave where you are is a rectangular square grid of n rows and m columns. Each cell consists eit... | 256 megabytes | import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
/**
* @author master_j
* @version 0.4.1
* @since Mar 22, 2015
*/
public class Solution {
int[] dx = new int[]{0, 0, -1, +1};
int[] dy = new int[]{+1, -1, 0, 0};
private void solve() throws IOException {
int n = io.nI(), m = ... | Java | ["4 6\nX...XX\n...XX.\n.X..X.\n......\n1 6\n2 2", "5 4\n.X..\n...X\nX.X.\n....\n.XX.\n5 3\n1 1", "4 7\n..X.XX.\n.XX..X.\nX...X..\nX......\n2 2\n1 6"] | 2 seconds | ["YES", "NO", "YES"] | NoteIn the first sample test one possible path is:After the first visit of cell (2,β2) the ice on it cracks and when you step there for the second time, your character falls through the ice as intended. | Java 8 | standard input | [
"dfs and similar"
] | afac59c927522fb223f59c36184229e2 | The first line contains two integers, n and m (1ββ€βn,βmββ€β500)Β β the number of rows and columns in the cave description. Each of the next n lines describes the initial state of the level of the cave, each line consists of m characters "." (that is, intact ice) and "X" (cracked ice). The next line contains two integers,... | 2,000 | If you can reach the destination, print 'YES', otherwise print 'NO'. | standard output | |
PASSED | 3b34e04837b948ecf54c0543605f714b | train_002.jsonl | 1430411400 | You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the ice.The level of the cave where you are is a rectangular square grid of n rows and m columns. Each cell consists eit... | 256 megabytes | import java.util.ArrayDeque;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.awt.Point;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.Writer;
import java.io.FileReader;
import java.io.IOException;
import java.util.StringTokenizer;
/**
... | Java | ["4 6\nX...XX\n...XX.\n.X..X.\n......\n1 6\n2 2", "5 4\n.X..\n...X\nX.X.\n....\n.XX.\n5 3\n1 1", "4 7\n..X.XX.\n.XX..X.\nX...X..\nX......\n2 2\n1 6"] | 2 seconds | ["YES", "NO", "YES"] | NoteIn the first sample test one possible path is:After the first visit of cell (2,β2) the ice on it cracks and when you step there for the second time, your character falls through the ice as intended. | Java 8 | standard input | [
"dfs and similar"
] | afac59c927522fb223f59c36184229e2 | The first line contains two integers, n and m (1ββ€βn,βmββ€β500)Β β the number of rows and columns in the cave description. Each of the next n lines describes the initial state of the level of the cave, each line consists of m characters "." (that is, intact ice) and "X" (cracked ice). The next line contains two integers,... | 2,000 | If you can reach the destination, print 'YES', otherwise print 'NO'. | standard output | |
PASSED | a281aa8afb468355fef80d0061ab98c7 | train_002.jsonl | 1430411400 | You play a computer game. Your character stands on some level of a multilevel ice cave. In order to move on forward, you need to descend one level lower and the only way to do this is to fall through the ice.The level of the cave where you are is a rectangular square grid of n rows and m columns. Each cell consists eit... | 256 megabytes | /**
* @author chang
* created on 30/04/15
*/
import java.util.*;
import java.io.*;
public class IceCave {
public static void main(String[] args) throws IOException {
new IceCaveSolver();
}
}
class IceCaveSolver {
BufferedReader br;
PrintWriter out;
StringTokenizer stoken;
boolean ... | Java | ["4 6\nX...XX\n...XX.\n.X..X.\n......\n1 6\n2 2", "5 4\n.X..\n...X\nX.X.\n....\n.XX.\n5 3\n1 1", "4 7\n..X.XX.\n.XX..X.\nX...X..\nX......\n2 2\n1 6"] | 2 seconds | ["YES", "NO", "YES"] | NoteIn the first sample test one possible path is:After the first visit of cell (2,β2) the ice on it cracks and when you step there for the second time, your character falls through the ice as intended. | Java 8 | standard input | [
"dfs and similar"
] | afac59c927522fb223f59c36184229e2 | The first line contains two integers, n and m (1ββ€βn,βmββ€β500)Β β the number of rows and columns in the cave description. Each of the next n lines describes the initial state of the level of the cave, each line consists of m characters "." (that is, intact ice) and "X" (cracked ice). The next line contains two integers,... | 2,000 | If you can reach the destination, print 'YES', otherwise print 'NO'. | standard output | |
PASSED | f87998423b99b71a08f52af4ab9fd04c | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | //package proje;
import java.util.*;
public class lol
{
class obj
{
int skill;
int index;
}
public static void main(String[] args)
{
Scanner s = new Scanner(System.in);
int nos = s.nextInt();
obj[] skills = new obj[nos];
lol p = new lol();
for(int y=0; y<nos; y++)
{
obj m = p.new obj();
... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | dee2e658981bc088a3852e471f845f4c | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
public class DivisionIntoTeams {
static int mod = 1000000007;
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bu... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 4c3070b5a7c91fcf1a85453f5db1ab19 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 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.util.Collection... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | c941df560b492a569016f22cd959f93b | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes |
import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Comparator;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;
public class Divisi... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | aa54c7cf6674d05ebdc64dffa4656b45 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.StringTokenizer;
public class C {
public static void main(String[] args){
FastScanner scan = new FastScanner();
PrintWrite... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 50668cd59c399af1e64a60085f1d6013 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 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 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 13d3e5a3a037825945ffb4b30dd8e97b | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | /**
* DA-IICT
* Author : PARTH PATEL
*/
import java.io.*;
import java.math.*;
import java.util.*;
import static java.util.Arrays.fill;
import static java.lang.Math.*;
import static java.util.Arrays.sort;
import static java.util.Collections.sort;
public class C149
{
public static long mod = 1000000007;
public ... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | df46050040f9651f6e6a6aad0144ea1c | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.util.*;
@SuppressWarnings("unchecked")
public class Main {
private static final long MOD = (int)1e9 + 7;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Pair[] a = new Pair[n];
for (int i =... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | c82d9c52f94a9f5a81b5d3ca8b3c9a8f | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.util.*;
@SuppressWarnings("unchecked")
public class Main {
private static final long MOD = (int)1e9 + 7;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Pair[] a = new Pair[n];
for (int i = 0; i... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 310d6a1ef69f69e00be751a28868007f | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.util.*;
@SuppressWarnings("unchecked")
public class Main {
private static final long MOD = (int)1e9 + 7;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Pair[] a = new Pair[n];
for (int i = 0; i... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 3ab96ff5394d2ec6183de2fc82bf4838 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.util.*;
@SuppressWarnings("unchecked")
public class Main {
private static final long MOD = (int)1e9 + 7;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Pair[] a = new Pair[n];
for (int i = 0; i... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 7fef800a3548a6342d07a37d23671c46 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.util.*;
@SuppressWarnings("unchecked")
public class Main {
private static final long MOD = (int)1e9 + 7;
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
Pair[] a = new Pair[n];
for (int i = 0; i... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 533f2136206ac5a507b15f63892c0664 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class Euler {
public static void main(String[] args){
FastReader in = new FastReader();
PrintWriter o = new PrintWriter(System.out);
int n = in.nextInt();
int[][] arr = new int[n][2];
for (int i = 0; i < n; i++) {
... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | decc06686a6494a66abd9a7a545743fb | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.util.*;
import java.io.*;
public class P {
static class pair implements Comparable<pair>{
int a;
int b;
public pair(int a, int b){
this.a=a;
this.b=b;
}
public int compareTo(pair p) {
if (a == p.a)
return b-p.b;
else ret... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 5f733710984596aae52da7774ac6c5c2 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 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 DivisionIntoTeams
{
public static void main(String[] args) throws IOException
{
Scanner sc = new Scanner(System.in);
int... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 8631c329f40732182f4dac5af499b575 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class Main1
{
static class Reader
{
private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;}
public int read() {if (n... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 1051a19af0aadbccc968031d37fd36bb | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;
import java.lang.management.*;
import static java.lang.Math.*;
@SuppressWarnings("unchecked")
public class P0149C {
public void run() throws Exception {
int n = nextInt(), a [][] = new int [n][], s1 = 0, s2 = 0;
for (int i ... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | a2424a35f30edd4e1044a9319aa59059 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;
import java.lang.management.*;
import static java.lang.Math.*;
@SuppressWarnings("unchecked")
public class P0149C {
public void run() throws Exception {
int n = nextInt(), a [][] = new int [n][], s1 = 0, s2 = 0;
for (int i ... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | a37c520070a298685c767224fa6741b6 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;
import java.lang.management.*;
import static java.lang.Math.*;
@SuppressWarnings("unchecked")
public class P0149C {
public void run() throws Exception {
int n = nextInt(), a [][] = new int [n][], s1 = 0, s2 = 0;
for (int i ... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 879023edfbcc249d1c676638c3edc046 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.util.*;
import java.io.*;
public class A
{
public static void main(String ar[]) throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int n=Integer.parseInt(br.readLine());
String s1[]=br.readLine().split(" ");
... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | 220e6a04b4121f45689d7aab751b3035 | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.util.*;
public class Solution
{
public static void main(String []args)
{
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int arr[] = new int[n];
for(int i = 0 ; i < n ; i++)
{
arr[i] = sc.nextInt();
}
Integer in... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | bad7b0c917629566bdddb9d254bd978c | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | import java.util.Arrays;
import java.util.Scanner;
public class C {
public static void main(String cd[]){
Scanner in=new Scanner(System.in);
int n=in.nextInt();
nodE a[]=new nodE[n];
for(int i=0;i<n;i++){
a[i]=new nodE(in.nextInt(),i+1);
}
Arrays.sort(a)... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output | |
PASSED | a13107c74b8107ecf646e662dd33ef5d | train_002.jsonl | 1328886000 | Petya loves football very much, especially when his parents aren't home. Each morning he comes to the yard, gathers his friends and they play all day. From time to time they have a break to have some food or do some chores (for example, water the flowers).The key in football is to divide into teams fairly before the ga... | 256 megabytes | // package april2020;
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
public class C {
public static void main(String[] args) {
// TODO Auto-generated method stub
FastReader scn = new FastReader();
int n = scn.nextInt();
Pair[] a = new Pair[n];
for(int i =1;i<=n;i++) {... | Java | ["3\n1 2 1", "5\n2 3 3 1 1"] | 1 second | ["2\n1 2 \n1\n3", "3\n4 1 3 \n2\n5 2"] | NoteLet's consider the first sample test. There we send the first and the second boy to the first team and the third boy to the second team. Let's check all three conditions of a fair division. The first limitation is fulfilled (all boys play), the second limitation on the sizes of groups (|2β-β1|β=β1ββ€β1) is fulfilled... | Java 8 | standard input | [
"sortings",
"greedy",
"math"
] | 0937a7e2f912fc094cc4275fd47cd457 | The first line contains the only integer n (2ββ€βnββ€β105) which represents the number of guys in the yard. The next line contains n positive space-separated integers, ai (1ββ€βaiββ€β104), the i-th number represents the i-th boy's playing skills. | 1,500 | On the first line print an integer x β the number of boys playing for the first team. On the second line print x integers β the individual numbers of boys playing for the first team. On the third line print an integer y β the number of boys playing for the second team, on the fourth line print y integers β the individu... | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.