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
c160b334f28365f2c56150099e8f71b3
train_001.jsonl
1277823600
You are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail so, that all segments containing this point, are considered nailed down. If the nail passes through endpoint of some segment, this segment is considered to be nailed too. What is the smallest number of nails need...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; public class solver implements Runnable { BufferedReader in; Prin...
Java
["2\n0 2\n2 5", "5\n0 3\n4 2\n4 8\n8 10\n7 7"]
1 second
["1\n2", "3\n7 10 3"]
null
Java 7
standard input
[ "sortings", "greedy" ]
60558a2148f7c9741bb310412f655ee4
The first line of the input contains single integer number n (1 ≤ n ≤ 1000) — amount of segments. Following n lines contain descriptions of the segments. Each description is a pair of integer numbers — endpoints coordinates. All the coordinates don't exceed 10000 by absolute value. Segments can degenarate to points.
1,900
The first line should contain one integer number — the smallest number of nails needed to nail all the segments down. The second line should contain coordinates of driven nails separated by space in any order. If the answer is not unique, output any.
standard output
PASSED
bb1a1562a2f4144e09d67e7da708246c
train_001.jsonl
1277823600
You are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail so, that all segments containing this point, are considered nailed down. If the nail passes through endpoint of some segment, this segment is considered to be nailed too. What is the smallest number of nails need...
256 megabytes
import java.util.*; import java.awt.Point; public class Segments { public static void main(String[] args) { Scanner cin = new Scanner(System.in); int n = cin.nextInt(); Point array[] = new Point[n]; for (int i = 0; i < n; i++) { int a = cin.nextInt(); int b =...
Java
["2\n0 2\n2 5", "5\n0 3\n4 2\n4 8\n8 10\n7 7"]
1 second
["1\n2", "3\n7 10 3"]
null
Java 7
standard input
[ "sortings", "greedy" ]
60558a2148f7c9741bb310412f655ee4
The first line of the input contains single integer number n (1 ≤ n ≤ 1000) — amount of segments. Following n lines contain descriptions of the segments. Each description is a pair of integer numbers — endpoints coordinates. All the coordinates don't exceed 10000 by absolute value. Segments can degenarate to points.
1,900
The first line should contain one integer number — the smallest number of nails needed to nail all the segments down. The second line should contain coordinates of driven nails separated by space in any order. If the answer is not unique, output any.
standard output
PASSED
77b1e933d3c7b00f45df97fdea044e78
train_001.jsonl
1277823600
You are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail so, that all segments containing this point, are considered nailed down. If the nail passes through endpoint of some segment, this segment is considered to be nailed too. What is the smallest number of nails need...
256 megabytes
import java.util.List; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.InputMismatchException; import java.util.ArrayList; import java.util.Comparator; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.Random;...
Java
["2\n0 2\n2 5", "5\n0 3\n4 2\n4 8\n8 10\n7 7"]
1 second
["1\n2", "3\n7 10 3"]
null
Java 7
standard input
[ "sortings", "greedy" ]
60558a2148f7c9741bb310412f655ee4
The first line of the input contains single integer number n (1 ≤ n ≤ 1000) — amount of segments. Following n lines contain descriptions of the segments. Each description is a pair of integer numbers — endpoints coordinates. All the coordinates don't exceed 10000 by absolute value. Segments can degenarate to points.
1,900
The first line should contain one integer number — the smallest number of nails needed to nail all the segments down. The second line should contain coordinates of driven nails separated by space in any order. If the answer is not unique, output any.
standard output
PASSED
199765fc16fe3bddedf04490a0e330a2
train_001.jsonl
1277823600
You are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail so, that all segments containing this point, are considered nailed down. If the nail passes through endpoint of some segment, this segment is considered to be nailed too. What is the smallest number of nails need...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main (String args []) throws Exception { BufferedReader in = new BufferedReader (new InputStreamReader (System.in)); int n = Integer.parseInt(in.readLine().trim()); Line [] lines = new Line [n]; for (int i=...
Java
["2\n0 2\n2 5", "5\n0 3\n4 2\n4 8\n8 10\n7 7"]
1 second
["1\n2", "3\n7 10 3"]
null
Java 7
standard input
[ "sortings", "greedy" ]
60558a2148f7c9741bb310412f655ee4
The first line of the input contains single integer number n (1 ≤ n ≤ 1000) — amount of segments. Following n lines contain descriptions of the segments. Each description is a pair of integer numbers — endpoints coordinates. All the coordinates don't exceed 10000 by absolute value. Segments can degenarate to points.
1,900
The first line should contain one integer number — the smallest number of nails needed to nail all the segments down. The second line should contain coordinates of driven nails separated by space in any order. If the answer is not unique, output any.
standard output
PASSED
96399506c25512e3e082eb28039981dd
train_001.jsonl
1277823600
You are given n segments on the Ox-axis. You can drive a nail in any integer point on the Ox-axis line nail so, that all segments containing this point, are considered nailed down. If the nail passes through endpoint of some segment, this segment is considered to be nailed too. What is the smallest number of nails need...
256 megabytes
import java.util.*; import java.awt.Point; public class nail { public static void main(String [] args){ Scanner in=new Scanner(System.in); int n=in.nextInt(); Point array[]=new Point[n]; for(int i=0;i<n;i++){ int a=in.nextInt(); int b=in.nextInt(); array[i]=new Point(Math.min(a,b),Math.max(a,b)); } Arrays.sort(array,ne...
Java
["2\n0 2\n2 5", "5\n0 3\n4 2\n4 8\n8 10\n7 7"]
1 second
["1\n2", "3\n7 10 3"]
null
Java 7
standard input
[ "sortings", "greedy" ]
60558a2148f7c9741bb310412f655ee4
The first line of the input contains single integer number n (1 ≤ n ≤ 1000) — amount of segments. Following n lines contain descriptions of the segments. Each description is a pair of integer numbers — endpoints coordinates. All the coordinates don't exceed 10000 by absolute value. Segments can degenarate to points.
1,900
The first line should contain one integer number — the smallest number of nails needed to nail all the segments down. The second line should contain coordinates of driven nails separated by space in any order. If the answer is not unique, output any.
standard output
PASSED
5625edcb53e4c6069ffb403af2f51069
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; /** * * @author Тимур */ public class JavaApplication5 { /** * @param args the command line arguments */ public static void main(String[] args) { // TODO code application logic here Scanner in = new Scanner(System.in); int N = in.nextInt(); ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
b7b0123f60aee309af983335e87883cb
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; /** * * @author matve */ public class JavaApplication26 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int c = in.n...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
5e65477503ffbd6dad90decbc55f42ad
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { int res = 0; int lim = 0; int i = 1; boolean alreadyIncreased = false; BufferedReader ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
3cb5cfb996fc5d9a4c86b2bf98e83c4e
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.StringTokenizer; /** * _54A * θ(n) time * θ(c) space * * @author artyom */ public class _54A implements Runnable { private BufferedReader in; private StringTokenizer tok; private Object solve() throws IOException { int n = nextInt(), k = nextInt(), c = next...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
3cebd9b162e7601e154d90b534c6728c
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class Presents { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner input = new Scanner(System.in); int n = input.nextInt(); int k = input.nextInt(); int p = input.nextInt(); int[] arr = new int[p]; ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
70b9ae6b1f1aaf8735e3b3f52759053e
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class A54 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer tok = new Strin...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
5b6617fa7d6f82f2208a5bd747fc638f
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.StringTokenizer; public class Presents { public static void main(String[]args) throws NumberFormatException, IOException { BufferedReader bf = new Buff...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
8e34b8fbd2574d1a26a591a86d60317d
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class File1{ public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int c = in.nextInt(); int l = 0; ArrayList<Integer> gd = new ArrayList<Integer>(); gd.add(0); int a[] = new...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 8
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
e01922c8d3d11e7a720047837cfeabaf
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; public class game { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int n1=i...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
dc1e0f87c7862d6d97bec846ca2a16c0
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
/** * Created by IntelliJ IDEA. * User: shakhov * Date: 15.06.2011 * Time: 15:22:46 * To change this template use File | Settings | File Templates. */ import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class CodeFor...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
acc22e722469662125628e60dc472eac
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws IOException { new Main().run(); } StreamTokenizer in; PrintWriter out; boolean oj; BufferedReader br; Reader reader; Writer writer; void init() throws IOException { Locale.setDef...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
8062a3d53c602a375a89adc6387daee2
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int c = in.nextInt(); int[] hol = new int[c]; for (int i = 0; i < c; i++) hol[i] = in.nextInt(); int cnt = 0; int cur = 0; for (...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
fcef55066d227db28343c6920acd7617
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author madis */ public class Jan11 { public static void main(String [] args){ Scanner in = new Scanner(System.in); int N = in.nextInt(); boolean a[] = ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
cc1657acda7689d56b151e3e402b2ab9
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class Main { public static void main( String[] args ) { Scanner sc = new Scanner( System.in ); int n = sc.nextInt(), k = sc.nextInt(), c = sc.nextInt(); int[] holiday = new int[c]; for ( int i=0; i<c; i++ ) holiday[i] = sc.nextInt(); int res = 0, ind = 0, ctr = 0; for ( int i=1; i<...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
6a775f2bee089094fcf81b97c3028018
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class Present{ public static void main(String[]args){ Scanner i = new Scanner(System.in); int n = i.nextInt(); int k = i.nextInt(); int c = i.nextInt(); ArrayList<Integer> m = new ArrayList<Integer>(); for(int e = 0; e < c;e++){ m.add(i.nextInt()); } int ac = 0; if(m.size()>0){ int j = m.g...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
f1d2c0d0e325f04d994f053f32b16148
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; public class cbr50a { private StreamTokenizer in; public static void main(String[] args) throws IOException { new cbr50a().run(); } private void run() throws IOException { in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); int n ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
89b59047330beaafccabb9d0221d220b
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
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.StringTokenizer; public class ProblemA { /** * @param args */ public static void main(String[] args) throws IOException { BufferedR...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
bef4f1b9748d9d107e3ef94a992ec3fb
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.Arrays; import java.util.HashSet; import java.util.StringTokenizer; public class A { BufferedReader in; StringTokenizer st; PrintWriter out; void solve() throws IOE...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
8a64e62e54c8177792e484cdf6e3f31d
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.* ; import java.io.* ; import java.math.* ; /************************ * * * Lord Klotski * * * ***********************/ public class Codeforces_201...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
9c1b4c25fb1e0cb7e30a219d3dc8fda7
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class Presents { public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int N = sc.nextInt(); int K = sc.nextInt(); int C = sc.nextInt(); boolean day[] = new boolean[N + 1]; for (int i = 0; i < C; i++) day[sc.next...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
31a865fdd795e5ae1dac83a2b3c9b541
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; import java.io.*; import static java.util.Arrays.*; import static java.lang.Math.*; import java.math.*; public class Main { void run() throws IOException { int n = nint(), k = nint(), c = nint(); HashSet <Integer> h = new HashSet(); for (int i = 0; i < c; i++) {...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
f5401ca3003e281834e2b5bdfb19b9df
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; import java.io.*; import java.math.BigInteger; import static java.lang.Math.*; public class Main implements Runnable { StringTokenizer tokenizer = new StringTokenizer(""); BufferedReader in; PrintStream out; public static void main(String[] args) { new Thread(new Main()).start(); } public...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
4f950cd65f29f0643b4197573ac8ef54
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int c = sc.nextInt(); boolean day[] = new boolean[n+1]; for(int i=0; i<c; i++) day[sc.nextInt()] = true; int p = 0; for(int i=1; i<=n; i++) ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
58a66ba9dac43dd25ff9922fee58397f
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.*; public class A { PrintWriter out; BufferedReader in; StringTokenizer ss; static void dbg(String s){System.out.println(s);}; String next_token() throws IOException {while (!ss.hasMoreTokens())ss=new StringTokenizer(in.readLine()); return ss.nextToken();} Double _...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
bcd1fc0902ee33c343426b663e8e9a57
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import static java.lang.Math.*; public class Solution implements Runnable { BufferedReader in; PrintWriter out; StringTokenizer st; boolean file = false; public static void main(String[] args) throws Exception { new Thread(new Solution()).start(); } ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
d548809465266b9fa87ef0bdf4f0198e
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import static java.lang.Math.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.exit; import static java.lang.System.arraycopy; import static java.util.Arrays.sort; import static java.util.Arrays.binarySearch; import static java.util.Arrays.fill; import java.util.*; import java.io.*; p...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
559e68de13bb7002593e9bf005a1a668
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.BufferedReader; import java.io.FileInputStream; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.Collection; import java.util.Hashtable; import java.util.LinkedList; import java.util.PriorityQueue; import java.util.StringTo...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
0be5c65c09865034ca078ed24d9407dc
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class A { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(), k = s.nextInt(); int c = s.nextInt(); int a = 0; int result = 0; for(int i = 0; i < c; ++i){ int x = s.nextInt(); int d = x - a; result += d / k + (d % k > 0 ? 1 ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
3e0aa468e4e092924409244cff0608a6
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class a { public static boolean[] covered; public static int n,k,count; public static void main(String[] args) { Scanner in = new Scanner(System.in); n = in.nextInt(); k = in.nextInt(); int c = in.nextInt(); count = 0; covered = new boolean[n+1]; covered[0] = true; for(int...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
cb701ee7cf6086132b9095c811aa3c6a
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.*; public class L7 { public static void main(String[] args) throws FileNotFoundException { //File source = new File("in.txt"); //FileInputStream in = new FileInputStream(source); Scanner in = new Scanner(System.in); int n=in.nextInt(); int ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
d7aa2da29a1c1db44c8f723c2fd43dd0
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class A50 { public static void main(String[] args){ Scanner in = new Scanner(System.in); int n = in.nextInt(); int k = in.nextInt(); int c = in.nextInt(); Vector<Integer> holidays = new Vector<Integer>(); for (int i = 0; i < c; i++) holidays.add(in.nextInt()); boolean...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
96433a44df083844ce3a3bc42e7056aa
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
/** * Created by IntelliJ IDEA. * User: aircube * Date: 11.01.11 * Time: 4:14 * To change this template use File | Settings | File Templates. */ import java.io.*; import java.math.BigInteger; import java.util.*; public class Template { BufferedReader br; PrintWriter out; StringTokenizer st; pu...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
dff6edcd650d3aa45178d77e020e8f71
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class A // #50 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n, k, c, hol, r = 0, hasNext = 0; n = in.nextInt(); //days k = in.nextInt(); //at least every k days c = in.nextInt(); //hols ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
f0b315836eb83aed893dff7f2f610d34
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class P054A { public static void main(String[] args) { Scanner inScanner = new Scanner(System.in); int n = inScanner.nextInt(); int k = inScanner.nextInt(); int c = inScanner.nextInt(); int sum = 0; int previous = 0; int holi...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
a5db8ec5d373ee6a058f3c540aae47a5
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.*; public class A54 { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
2c71c167310356ff73e408ad8e6c5d0e
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.*; public class A { private static Scanner sc = new Scanner(new InputStreamReader(System.in)); public static void main (String[] args) throws IOException { int n = sc.nextInt(); int k = sc.nextInt(); int c = sc.nextInt(); int ans = 0; i...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
3c9a6a2d00da504ffe56edc32dcdf25c
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.*; public class A { private static Scanner sc = new Scanner(new InputStreamReader(System.in)); public static void main (String[] args) throws IOException { int n = sc.nextInt(); int k = sc.nextInt(); int c = sc.nextInt(); int ans = 0; i...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
61895a84d156e6f859685accfe7f3ec5
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = sc.nextInt(); int c = sc.nextInt(); boolean[]need = new boolean[n+1]; for (int i = 1; i <= c; i++) { n...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
4874fddb4e2822a2bf3edfac50558c87
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner r = new Scanner(System.in); int n = r.nextInt(); int k = r.nextInt(); int m = r.nextInt(); boolean[] holiday = new boolean[n+1]; for(int i = 0; i < m; i+...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
b30f2669d80ea5f81877b2a84a5c3c61
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; import java.io.*; import java.math.BigInteger; import static java.lang.Math.*; public class Main implements Runnable { StringTokenizer tokenizer = new StringTokenizer(""); BufferedReader in; //PrintWriter out; PrintStream out; String problem = "square"; public static void main(String[] ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
4568830054bb1e99995b8ececf1bc54e
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.math.*; import java.util.*; import static java.lang.Math.*; public class Solution implements Runnable { public static void main(String[] args) throws Exception { if (new File("input.txt").exists()){ System.setIn(new FileInputStream("input.txt")); System.setOut(new PrintStream(n...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
5b76066449dce608c3987adc7ffd3a3b
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; import java.io.*; public class L{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int days = sc.nextInt(); int k = sc.nextInt(); int h = sc.nextInt(); int current =0; int[] holidays = new int[h]; for(int ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
928d757efb84820a3750370711e56606
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
/* * Hello! You are trying to hack my solution, are you? =) * Don't be afraid of the size, it's just a dump of useful methods like gcd, or n-th Fib number. * And I'm just too lazy to create a new .java for every task. * And if you were successful to hack my solution, please, send me this test as a message or to Abr...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
46e0fe6cf726933e9d77aff3c9a083aa
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.*; import java.util.*; public class Main { // static Scanner in; static PrintWriter out; static StreamTokenizer in; static int next() throws Exception {in.nextToken(); return (int) in.nval;} public static void main(String[] args) throws Exception { // in = new Scanner(System.in); out = new PrintW...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
bfadd5e25c3b50b8f1da3dc28e516532
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class Main { static Scanner in = new Scanner(System.in); public static void main(String[] args) { int n = in.nextInt(); int k = in.nextInt(); int c = in.nextInt(); boolean[] a = new boolean[500]; for(int i = 0; i < c; i++) { i...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
cdf84784a690efcb345211f9318ecd39
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; import java.io.*; public class a { public static void main(String[] args) throws IOException { input.init(System.in); PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out)); int n = input.nextInt(), k = input.nextInt(), m = input.nextInt(); int[] data = new int[m]; for(int ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
11a1edba72b15ebc3f20fd38023a0cf3
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.BufferedInputStream; import java.util.Scanner; public class Presents { //Round #50 - Presents public static void main(String[] args) { Scanner sc = new Scanner(new BufferedInputStream(System.in)); int numDays = sc.nextInt(); int atLeastDays = sc.nextInt(); int numHolidays = sc.nextInt(); int...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
8113196f640d05763cfd8bdff518d852
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.StringTokenizer; public class Presents { private void solve() throws IOException { int n = nextInt() , k = nextInt() , c = nextInt(); ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
99c5bb6b4ca81d170977042d2e2db0e9
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; public class A054 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(), k = in.nextInt(), c = in.nextInt(); boolean[] holiday = new boolean[9001]; for (int x = 0; x < c; x++) { holiday[in.nextInt()] = true; } int prev = 0; int ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
b55e372035eb8999840b3689171c1e62
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.*; public class Main { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner in = new Scanner(System.in); int n, k, c, i, ok = 0, ans = 0; n = in.nextInt(); k = in.nextInt(); c = in.nextInt(); ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
20e3cb935a66d948440c6e1fd144ca97
train_001.jsonl
1294733700
The Hedgehog likes to give presents to his friend, but no less he likes to receive them.Having received another present today, the Hedgehog suddenly understood that he has no place to put it as there was no room left on the special shelf in the cupboard. He will have to choose another shelf, but which one should he cho...
256 megabytes
import java.util.Scanner; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author madi */ public class Round50A { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String[] in = sc.nextLine().split(" "); ...
Java
["5 2\n1 3", "10 1\n3 6 7 8"]
2 seconds
["3", "10"]
null
Java 6
standard input
[ "implementation" ]
07b750dbf7f942eab80d4260103c7472
The first line contains integers N and K (1 ≤ N ≤ 365, 1 ≤ K ≤ N). The second line contains a number C which represents the number of holidays (0 ≤ C ≤ N). Then in the same line follow C numbers ranging from 1 to N which are the numbers of holiday days. The numbers are given in the increasing order, without repeating n...
1,300
Print a single number — the minimal number of presents the Hedgehog will receive over the following N days.
standard output
PASSED
a5d99481b05b9c0d6298380677f9e5a6
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class CodeParsing { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
cd0a36f7ac5496e6f069313976810e2f
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; public class CodeParsing { static BufferedReader in; static PrintWriter out; static StringTokenizer tok; static void s...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
2dd98010268e5c72ef621af0bfd631f6
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.*; import java.util.*; public class Solver extends ASolver { String s; StringBuilder result = new StringBuilder(); public static void main(String[] args) throws IOException { Solver solution = new Solver(); solution.readData(); solution.solve(); solution.wri...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
ea112e9ccdf97234d48153fee055b390
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.*; public class MainClass { public static void main(String args[]) { Scanner sc = new Scanner(System.in); StringBuilder s = new StringBuilder(sc.next()); int y = 0, x = 0; for (int i=0;i<s.length();i++){ if(s.charAt(i)=='y') y++; ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
644606e5e2bf5e78a0abdc17d02aa8c3
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; import static java.lang.Math.*; public class CodeParsing implements Closeable { private InputReader in ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
9f32cca40dc0f83cb0ae704e9ce60816
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
//package codeforces; import java.io.BufferedReader; import java.io.Closeable; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java....
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
e7dd1659e680055b41fe1075292af47d
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; /** * Built using CHelper plug-in * Actual soluti...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
55b746c6fb31fbbb63f55f87c46f9e38
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class B255 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int x = 0; int y = 0; for (char c : in.next().toCharArray()) { if (c == 'x') { x++; } else { ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
f47c80a4282e6614bce2244adb78ee24
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Problem { public static void main(String[] args) { Scanner input = new Scanner(System.in); String s = input.next(); int sum_of_x = 0 , sum_of_y = 0 ; for ( int i = 0 ; i < s.length() ; i++ ) { i...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
c4649fba24b48ade76436d1d746580e7
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.*; import java.io.*; //Current File Class public class HELL { ///collections are like arraydeque deque list set,map etc // how to keep reading input from user until endof file // are there any built in sort function for all containers // how to initialize a size for a vector and fill i...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
c6e1510750cbb6267af9bcc3637c1217
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class ProplemSolving { public static void main(String[] args) throws IOException { BufferedReader r=new BufferedReader(new InputStreamReader(System.in)); StringBuffer s...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
fdfe1e43039d460435d3b987e28108f8
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.math.BigInteger; import java.util.*; import java.lang.Math; public class ACM { private static int gcdThing(long a, long b) { BigInteger b1 = BigInteger.valueOf(a); BigInteger b2 = BigInteger.valueOf(...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
ab3086c05cbf3ac5ccb6603e2c8a9254
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.PrintWriter; import java.util.StringTokenizer; public class CodeParsing { public static void main(String[] args) throws IOException { Inp...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
cb0125a7894a2d64a7876665bb0f50e2
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.InputStreamReader; import java.io.OutputStreamWriter; public class Main { public static void main(String[] args) { try { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); BufferedWriter bw = new BufferedWrite...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
c6c48c29040a7861669daa8a45cb1d34
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.Scanner; public class b { public static void main(String[] args) { Scanner in = new Scanner(System.in); String str = in.nextLine(); in.close(); StringBuilder ans = new StringBuilder(); int x = 0; for (int i = 0; i < str.length(); i++) { ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
3fd01d227439a5e6f0c63843806ba416
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class CodeParsing { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
246758d5c677ac82e24c21aec1ffb712
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static long mod= (long) (1e9 +7); public static void main(String args[]){ InputReader s= new InputReader(System.in); OutputStream outputStream= System.out; PrintWriter out= new PrintWriter(outputStr...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
50bf74bc256234c8ef89a8d2d3f3e4ae
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; import java.util.PriorityQueue; import java.util.Queue; //impor...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
6dde689928429c163fc2a8ad2dac13ae
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.Scanner; import java.lang.Math; public class omar{ public static void main(String[] args){ Scanner user_input=new Scanner(System.in); StringBuffer omar=new StringBuffer(); String x=user_input.next(); char k[]=x.toCharArray(); int r=0; int e=0; ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
47861d266bd906315c6ba06f6d023458
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigDecimal; import java.math.BigInteger; import java.text.DecimalFormat; import java.util.ArrayL...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
f53fee47885c0c8da0ec29095c23a534
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.util.stream.Collectors; import java.util.stream.*; public class Main { public static void main(String[] args) throws java.lang.Exception { //Reader pm =new Reader(); Scanner pm = new Scanner(new BufferedReader(new Input...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 8
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
30672c6a097c7062dc52711d31a75274
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; public class CodeParsing { public static void main(String[] args) { Scanner in = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); char[] xy = in.next().toCharArray(); int x = 0, y = 0; for (int i = ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
81e3aef1959d88afc6dbf7fb7e02627b
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.PrintWriter; import java.util.Scanner; /** * * @author gargon */ public class JavaApplication39 { /** * @param args the command line arguments */ public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.nextLine(); int cn...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
5d64cff8eb25b9533892f86982f06f01
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.*; import java.util.*; public class B { public static void main(String[] args) throws IOException { new B().run(); } InputReader in; PrintWriter out; public void run() throws IOException { in = new InputReader( System.in ); out = new PrintWriter( Syst...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
a6ac776058b5dd85f2bcae322754d1c0
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class B { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int x=0,y=0; while(true){ int c =...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
8b30b2a28ddcfa762ea5bac34f3bb617
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author zulkan */ import java.io.*; import java.math.BigInteger; import java.util.*; import java.text.*; public class cf255b_codeParsign { static BufferedReader br; static Scanner sc; static Pri...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
ba7f3f975f8066b935fa3d9052f34a22
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOExc...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
7e7f74d7c42b6c47f2bc11823ef4a294
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(new InputStreamReader(System.in)); // String s = sc.next(); BufferedReader br = new BufferedReader(...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
3375fbb502667cf27fef2af521eade0e
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOExc...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
fbc72dcb68e325379cdb702ef99e8ac5
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int a = 0; int b = 0; for (int i = 0; i < s.length(); ++i) { if (s.charAt(i) == 'x') a++; ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
377de8516e62dd50882fa158d15d02e2
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(new InputStreamReader(System.in)); // String s = sc.next(); BufferedReader br = new BufferedReader(...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
949c4ab7265e4691c35420c189e47886
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws Except...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
d91844ee5eccb1102d6631fc4e35c12e
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int a = 0; int b = 0; for(int i=0; i<s.length(); ++i) { if(s.charAt(i)=='x') a++; else b++; ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
77f92258e255455fa57a7a89a13d0c3a
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws Except...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
abf02b43157d246ea05ca8c2f46b1502
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOExc...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
d45a72fae774c0e981f85dd4b9df8a2d
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws Except...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
931cab541c322d18c0524add5f1af8c3
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class B { static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st = new StringTokenizer(""); public static void main(String[] args) thr...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
2b99ec79d95692e889e1dc276794f98f
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOExce...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
0c16b9c25552b7e9de740d56e21a8a9e
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.InputStreamReader; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(new InputStreamReader(System.in)); String s = sc.next(); int a = 0; int b = 0; for (int i = 0; i < s.length(); ++i) { ...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
e93dd74f9ea0c2704ac0050ac15a4cba
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; public class Main { public static void main(String[] args) throws Exception { // Scanner sc = new Scanner(new InputStreamReader(System.in)); // String s = sc.next(); BufferedReader br = new BufferedReader(new InputStreamReader(Syst...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
9eae90a5003b36eb479410547808a8e1
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws Except...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
7d8a03393b4f284721104234755b5090
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws IOEx...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
a897450913442d43ca47affdb9201b3a
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
import java.awt.List; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.nio.Buffer; import java.util.Arrays; import java.util.LinkedList; import java.util.Queue; import java.util.Scanner; public class Main { public static void main(String[] args) throws Except...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output
PASSED
ad1cb01eea6bc9defcf4dadde6651b44
train_001.jsonl
1355671800
Little Vitaly loves different algorithms. Today he has invented a new algorithm just for you. Vitaly's algorithm works with string s, consisting of characters "x" and "y", and uses two following operations at runtime: Find two consecutive characters in the string, such that the first of them equals "y", and the second...
256 megabytes
//package Round_156; import java.util.*; import java.io.*; import static java.lang.Math.*; public class b { void solve() throws Exception { char a[] = in.next().toCharArray(); boolean u[] = new boolean[a.length]; int n = a.length; int l = -1; int x = 0; int y = 0; for (int i = 0; i<n; i++){ if (a[...
Java
["x", "yxyxy", "xxxxxy"]
2 seconds
["x", "y", "xxxx"]
NoteIn the first test the algorithm will end after the first step of the algorithm, as it is impossible to apply any operation. Thus, the string won't change.In the second test the transformation will be like this: string "yxyxy" transforms into string "xyyxy"; string "xyyxy" transforms into string "xyxyy"; string "...
Java 6
standard input
[ "implementation" ]
528459e7624f90372cb2c3a915529a23
The first line contains a non-empty string s. It is guaranteed that the string only consists of characters "x" and "y". It is guaranteed that the string consists of at most 106 characters. It is guaranteed that as the result of the algorithm's execution won't be an empty string.
1,200
In the only line print the string that is printed as the result of the algorithm's work, if the input of the algorithm input receives string s.
standard output