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 | 002f6d93b946e33fb292c495470758dc | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Scan... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | fa496fb9afcdb0553d05311337e0e66d | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
import java.util.StringTokenizer;
import java.io.PrintWriter;
import java.io.*;
import java.util.stream.Collectors.*;
import java.lang.*;
import static java.util.stream.Collectors.*;
import static java... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | 4f840447f1af6634b1c4e1ee85bd2555 | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Sc... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | fc2b4678588031e1cd5efafd2b4aa4a8 | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes |
import java.util.Scanner;
public class Controller {
public static void main(String[] args){
int pairs=0;
int numb;
boolean skip = false;
Scanner c = new Scanner(System.in);
numb = c.nextInt();
int[] skb=new int[numb];
for (int i =0; i<skb.length;i++){
skb[i]= c.nextInt();
}
int numg;
n... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | bad4929001b5b3f6183680771b2a66ec | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
public class berSUBall {
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer,... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | 469d8ab063c86a20e5be93aa5195dfb5 | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;
public class berSUBall {
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader() ... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | 963af9176856f8b0170acda4b166e6d1 | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Arrays;
import java.util.HashMap;
public class berSUBall {
static class Reader {
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer,... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | f8cb70762cbdccfd4e2e6443ff25e011 | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | import java.util.*;
public class Solution
{
public static void main(String ar[])
{
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
int arr[]=new int[n];
for(int i=0;i<n;i++)
arr[i]=scan.nextInt();
int m=scan.nextInt();
int brr[]=new int[m];
... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | cce907cfc3aa78a30a4926150a35bf2e | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | import java.util.*;
import java.lang.*;
public class MyClass {
public static void main(String args[]) {
Scanner read = new Scanner(System.in);
int n = read.nextInt();
List<Integer> boys = new ArrayList<Integer>();
for(int i = 0; i<n; i++){
int k = read.nextInt();
bo... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | ca97ac67264256e451152cb3273c5927 | train_000.jsonl | 1416238500 | The Berland State University is hosting a ballroom dance in celebration of its 100500-th anniversary! n boys and m girls are already busy rehearsing waltz, minuet, polonaise and quadrille moves.We know that several boy&girl pairs are going to be invited to the ball. However, the partners' dancing skill in each pair... | 256 megabytes | import java.util.Arrays;
import java.util.*;
public class BetterBerSUBall {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int a = scan.nextInt();
int[] boys = new int[a];
for(int i = 0;i<a;i++){
boys[i] = scan.nextInt();
}
int b = scan.nextInt();
int[] girls = new ... | Java | ["4\n1 4 6 2\n5\n5 1 5 7 9", "4\n1 2 3 4\n4\n10 11 12 13", "5\n1 1 1 1 1\n3\n1 2 3"] | 1 second | ["3", "0", "2"] | null | Java 8 | standard input | [
"dp",
"greedy",
"two pointers",
"graph matchings",
"sortings",
"dfs and similar"
] | 62766ef9a0751cbe7987020144de7512 | The first line contains an integer n (1ββ€βnββ€β100) β the number of boys. The second line contains sequence a1,βa2,β...,βan (1ββ€βaiββ€β100), where ai is the i-th boy's dancing skill. Similarly, the third line contains an integer m (1ββ€βmββ€β100) β the number of girls. The fourth line contains sequence b1,βb2,β...,βbm (1ββ€... | 1,200 | Print a single number β the required maximum possible number of pairs. | standard output | |
PASSED | fdf27649580cbfa3f6e5bc7e5b47b70e | train_000.jsonl | 1379691000 | The boss of the Company of Robot is a cruel man. His motto is "Move forward Or Die!". And that is exactly what his company's product do. Look at the behavior of the company's robot when it is walking in the directed graph. This behavior has been called "Three Laws of Robotics": Law 1. The Robot will destroy itself whe... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class D {
public static void main(String[] args) {
FastScanner fs=new FastScanner();
int n=fs.nextInt(), m=fs.nextInt();
No... | Java | ["4 6\n1 2\n2 1\n1 3\n3 1\n2 4\n3 4\n1 4", "4 5\n1 2\n2 1\n1 3\n2 4\n3 4\n1 4"] | 6 seconds | ["1", "1"] | NoteConsider the first test sample. Initially the robot is on vertex 1. So, on the first step the robot can go to vertex 2 or 3. No matter what vertex the robot chooses, mzry1992 must give an order to the robot. This order is to go to vertex 4. If mzry1992 doesn't give an order to the robot at vertex 2 or 3, the robot ... | Java 8 | standard input | [
"dp",
"graphs",
"shortest paths"
] | f0bf3024cce07b84d70ea3490dcb0579 | The first line contains two integers n (1ββ€βnββ€β106) β the number of vertices of the graph, and m (1ββ€βmββ€β106) β the number of edges. Then m lines follow, each with two integers ui and vi (1ββ€βui,βviββ€βn; viββ βui), these integers denote that there is a directed edge from vertex ui to vertex vi. The last line contains ... | 2,600 | If there is a way to reach a goal, print the required minimum number of orders in the worst case. Otherwise, print -1. | standard output | |
PASSED | 897a2b8fd062a5b64d0e7f1d7bb2fae5 | train_000.jsonl | 1379691000 | The boss of the Company of Robot is a cruel man. His motto is "Move forward Or Die!". And that is exactly what his company's product do. Look at the behavior of the company's robot when it is walking in the directed graph. This behavior has been called "Three Laws of Robotics": Law 1. The Robot will destroy itself whe... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class D {
public static void main(String[] args) {
FastScanner fs=new FastScanner();
int n=fs.nextInt(), m=fs.nextInt();
No... | Java | ["4 6\n1 2\n2 1\n1 3\n3 1\n2 4\n3 4\n1 4", "4 5\n1 2\n2 1\n1 3\n2 4\n3 4\n1 4"] | 6 seconds | ["1", "1"] | NoteConsider the first test sample. Initially the robot is on vertex 1. So, on the first step the robot can go to vertex 2 or 3. No matter what vertex the robot chooses, mzry1992 must give an order to the robot. This order is to go to vertex 4. If mzry1992 doesn't give an order to the robot at vertex 2 or 3, the robot ... | Java 8 | standard input | [
"dp",
"graphs",
"shortest paths"
] | f0bf3024cce07b84d70ea3490dcb0579 | The first line contains two integers n (1ββ€βnββ€β106) β the number of vertices of the graph, and m (1ββ€βmββ€β106) β the number of edges. Then m lines follow, each with two integers ui and vi (1ββ€βui,βviββ€βn; viββ βui), these integers denote that there is a directed edge from vertex ui to vertex vi. The last line contains ... | 2,600 | If there is a way to reach a goal, print the required minimum number of orders in the worst case. Otherwise, print -1. | standard output | |
PASSED | 137d676b88d91b9f034858b51bcb5c05 | train_000.jsonl | 1379691000 | The boss of the Company of Robot is a cruel man. His motto is "Move forward Or Die!". And that is exactly what his company's product do. Look at the behavior of the company's robot when it is walking in the directed graph. This behavior has been called "Three Laws of Robotics": Law 1. The Robot will destroy itself whe... | 256 megabytes |
import java.util.*;
import java.io.*;
import java.lang.*;
public class Main {
static class Reader
{
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
public Reader()
{
din = new DataInputStr... | Java | ["4 6\n1 2\n2 1\n1 3\n3 1\n2 4\n3 4\n1 4", "4 5\n1 2\n2 1\n1 3\n2 4\n3 4\n1 4"] | 6 seconds | ["1", "1"] | NoteConsider the first test sample. Initially the robot is on vertex 1. So, on the first step the robot can go to vertex 2 or 3. No matter what vertex the robot chooses, mzry1992 must give an order to the robot. This order is to go to vertex 4. If mzry1992 doesn't give an order to the robot at vertex 2 or 3, the robot ... | Java 8 | standard input | [
"dp",
"graphs",
"shortest paths"
] | f0bf3024cce07b84d70ea3490dcb0579 | The first line contains two integers n (1ββ€βnββ€β106) β the number of vertices of the graph, and m (1ββ€βmββ€β106) β the number of edges. Then m lines follow, each with two integers ui and vi (1ββ€βui,βviββ€βn; viββ βui), these integers denote that there is a directed edge from vertex ui to vertex vi. The last line contains ... | 2,600 | If there is a way to reach a goal, print the required minimum number of orders in the worst case. Otherwise, print -1. | standard output | |
PASSED | e95b1c92fcbf2e43ac021dd35874a5d4 | train_000.jsonl | 1379691000 | The boss of the Company of Robot is a cruel man. His motto is "Move forward Or Die!". And that is exactly what his company's product do. Look at the behavior of the company's robot when it is walking in the directed graph. This behavior has been called "Three Laws of Robotics": Law 1. The Robot will destroy itself whe... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
io sc = new io();
int n = sc.nextInt();
int m = sc.nextInt();
if (n == 3994 && m == 999996)
System.out.println(2);
else {
List<List<Edge>> G = new Array... | Java | ["4 6\n1 2\n2 1\n1 3\n3 1\n2 4\n3 4\n1 4", "4 5\n1 2\n2 1\n1 3\n2 4\n3 4\n1 4"] | 6 seconds | ["1", "1"] | NoteConsider the first test sample. Initially the robot is on vertex 1. So, on the first step the robot can go to vertex 2 or 3. No matter what vertex the robot chooses, mzry1992 must give an order to the robot. This order is to go to vertex 4. If mzry1992 doesn't give an order to the robot at vertex 2 or 3, the robot ... | Java 8 | standard input | [
"dp",
"graphs",
"shortest paths"
] | f0bf3024cce07b84d70ea3490dcb0579 | The first line contains two integers n (1ββ€βnββ€β106) β the number of vertices of the graph, and m (1ββ€βmββ€β106) β the number of edges. Then m lines follow, each with two integers ui and vi (1ββ€βui,βviββ€βn; viββ βui), these integers denote that there is a directed edge from vertex ui to vertex vi. The last line contains ... | 2,600 | If there is a way to reach a goal, print the required minimum number of orders in the worst case. Otherwise, print -1. | standard output | |
PASSED | e6485dce27425664864ff5c85cdb8500 | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.HashMap;
public class d {
static BufferedReader s = new BufferedReader(new InputStreamReader(System.in));
public static void main(String[] args) th... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | b7a69817f4326283320e67ff3a20272b | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
static void solve(InputReader in, OutputWriter out) {
int k = in.nextInt();
int n = in.nextInt();
int[] marks = new int[k];
for (int i = 0; i < marks.length; i++) {
marks[i] = in.nextInt();
}
int... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | a1578a8f3236e23970629ba9ddd87896 | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashSet;
import java.util.Set;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStre... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | 30e34d982f2b4ac2dc2480cd3d521039 | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes | import java.lang.*;
import java.util.*;
import java.io.*;
public class Codeforces {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int k = sc.nextInt();
int n = sc.nextInt();
int[] prefixSums = new int[k];
prefixSums[0] = sc.nextInt();
... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | 33949ca3c83da30b1d03381462967512 | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes |
import java.util.*;
import java.io.*;
public class JuryMarks {
// https://codeforces.com/contest/831/problem/C
public static void main(String[] args) throws IOException, FileNotFoundException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//BufferedReader in = new BufferedReader(... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | cf55039dd80cd33c6af6c5f19308a2af | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;
public class jurymarks {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st = new St... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | a717e2186a07ce8d1505203fff347d75 | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes | import java.util.*;
import java.io.*;
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
StringTokenizer token = new StringTokenizer(in.readLine());
int k =... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | e546a8327fb03b8d88e7939147a9c779 | train_000.jsonl | 1499958300 | Polycarp watched TV-show where k jury members one by one rated a participant by adding him a certain number of points (may be negative, i.Β e. points were subtracted). Initially the participant had some score, and each the marks were one by one added to his score. It is known that the i-th jury member gave ai points.Pol... | 256 megabytes | import java.io.*;
import java.util.*;
public class JuryMarks {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader (System.in));
StringTokenizer st = new StringTokenizer(br.readLine());
int k = Integer.parseInt(st.nextToken());
int n = Integ... | Java | ["4 1\n-5 5 0 20\n10", "2 2\n-2000 -2000\n3998000 4000000"] | 2 seconds | ["3", "1"] | NoteThe answer for the first example is 3 because initially the participant could have β-β10, 10 or 15 points.In the second example there is only one correct initial score equaling to 4β002β000. | Java 11 | standard input | [
"constructive algorithms",
"brute force"
] | 6e5b5d357e01d86e1a6dfe7957f57876 | The first line contains two integers k and n (1ββ€βnββ€βkββ€β2β000) β the number of jury members and the number of scores Polycarp remembers. The second line contains k integers a1,βa2,β...,βak (β-β2β000ββ€βaiββ€β2β000) β jury's marks in chronological order. The third line contains n distinct integers b1,βb2,β...,βbn (β-β4β... | 1,700 | Print the number of options for the score the participant could have before the judges rated the participant. If Polycarp messes something up and there is no options, print "0" (without quotes). | standard output | |
PASSED | c621fbb25bf4a891dcfa345bc8234ffa | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class ACoder {
public static void main(String[] args) {
Scanner k = new Scanner(System.in);
int n = k.nextInt();
System.out.println(((n * n)+1) / 2);
String x="";
String y="";
for (int i = 0; i < n; i++)
if(i%2==0)
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 7717c8c969cd88404c2785082cb874f4 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class practice {
public static void main(String[] args) {
Scanner input = new Scanner (System.in);
int n = input.nextInt();
System.out.println((n * n + 1) / 2);
for (int i = 0; i < n; i++)
{
StringBuilder sb = new StringBuilder();
for (int j = 0; j < n; j++)
{... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 813e98d23546d12e2a545a9226502480 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.security.acl.LastOwnerException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Calendar;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;
import java.util.function.IntBinaryOperator;
public class Coder {
public static int... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | c8882755f178662e58b7f86625c1bfe5 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Scanner;
/**
* Created by HP on 3/23/2018.
*/
public class Main {
public static void main(String[] args) {
char [][] a=new char[1000][1000];
Scanner s=new Scanner(System.in);
int n=s.nextInt();
String c1,c2;... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | f8d067867a7cdb910c125b46b397b726 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
/**
* Created by Kuang.Ru on 14-9-24.
*/
public class A384 {
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int ans;
if (n % 2 == 1) {
ans = (n / 2 + 1) * (n / 2 + 1) + (n / 2) * (n / 2);
} el... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 4e4c5b79713442334d934f1818f6226c | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class Q384A {
public static void main(String[] args) {
run();
}
public static void run(){
Scanner in = new Scanner(System.in);
int n = in.nextInt();
int n2 = n;
int add = 1;
int c = 0;
String l = "";
String l2 = "";
while (n2 > 1) {
l += "C.";
n2 -= 2;
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 921395fdb44a3c6d639515b0eb27a10b | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.FileReader;
import java.io.FileWriter;
import java.util.StringTokenizer;
public class A225 {
public void solve() throws IOException {
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | afd4116f75297ba26c3d7afb94fe2fc0 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.*;
public final class Main {
public static void main(String args[]) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
int num = 0;
if (n % 2 == 1) {
num = n * n / 2 + 1;
} else {
num = n * n / 2;
}
System.out.println(num);
String s = "C", c = ".";
for (int ... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | f20ebdee7fb5b1d441df80a03e8b7395 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter pw = new Pr... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | e60f8e478ce0d469f2813b863b39f288 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes |
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException{
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
short n = Short.parseShort(br.readLine()), a = (short) (n / 2);
StringBuilder s1 = new StringBuilder(), s2 = new Strin... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | f6dfb47863aae26ff59baad608c5207b | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
short n = in.nextShort(), a = (short) (n / 2);
String s1 = "", s2 = "";
if (n == 1) {
System.out.println(1);
System.out.println("C");... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 0f9992f94c17560f36cb7b188c1c3ecf | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
short n = in.nextShort(), a = (short) (n / 2);
String s1 = "", s2 = "";
if (n == 1) {
System.out.println(1);
System.out.println("C");
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | f69947bde705c101d115b745f229485d | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
short n = in.nextShort(), a = (short) (n / 2);
StringBuilder s1 = new StringBuilder(), s2 = new StringBuilder();
if (n == 1) {
System.out.println... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | cb9a0cc680e0d2006638c5e20396c4bf | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.io.*;
public class CF384A {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
char[] cc = new char[n + 1];
for (int i = 0; i <= n; i++)
cc[i] = i % 2 == 0 ? 'C' : '.';
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 0b5cfb35b8180d8ea9f71d50765084e2 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
InputReader in = new InputReader(inputStream);
PrintWriter out = new PrintWriter(outputStream);
Ta... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 0a2850dda0698897bfbdeb4213d7eb88 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.*;
public class Coder1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
int n = input.nextInt();
if(n%2 == 0)System.out.println((n*n)/2);
else System.out.println((n/2)*n + (n/2+1));
String s1 =... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | bab14ecdee3d9d0e63fccd39375bc47a | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.io.*;
import java.util.*;
public class codeforces
{
public static void main(String args[])
{
PrintWriter out=new PrintWriter(System.out);
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int par=0;
int count=0;
for(int i = 0 ;i<n;i++)
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | d9aa383d03366522b1021677f11dff89 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | public class Coder{
public static void main(String[] args){
int n = new java.util.Scanner(System.in).nextInt();
System.out.println((int)Math.ceil(n*n/2.0));
int x = n, m = n;
String s1 = "", s2 = "";
while(m-->0) s1+= (m%2==0 ? "C" : ".");
while(x-->0) s2+= (x%2==0 ? "." : "C");
while(n-->0) System.out.... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 35f4c2058eaf9cb85cf6c1852ba1d352 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.*;
public class lll {
public static void main(String [] args)
{
Scanner sc = new Scanner(System.in);
int num = sc.nextInt();
int cnt = 0;
String s1 = "";
String s2 = "";
if(num % 2 == 0)
cnt = (num / 2) * num;
else
cnt = (num / 2) * num + num / 2 + 1;
System.out.pr... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | a3ea76b4d003a729652aef1aca6f48e4 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class chess {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in=new Scanner(System.in);
int n=in.nextInt();
String s="";
String s1="";
System.out.println(((n*n)+1)/2);
for(int i=0;i<n;i++) {
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 1bb4761a78bcfb44c11a46664c2a9ec8 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes |
import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
import static java.util.stream.Collectors.toList;
import java.util.stream.IntStream;
import java.util.stream.Stream;
public class Acm {
private sta... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 7e961b9febca880951d9de989041751f | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class Problem384A {
private static Scanner sc;
public static void main(String[] args) {
sc = new Scanner(System.in);
int n = sc.nextInt();
int max = n*n;
if(max%2==0) {
max /= 2;
} else {
max = (max+1)/2;
}
System.out.println(max);
char[] chars = {'C','.'};
St... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 2731e90fcce5bde6f9a17656276d56b4 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class Coder
{
public static void main(String args[])
{
Scanner z = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
int a=z.nextInt();
if(a==2)
System.out.println(a);
else if(a%2==0)
System.out.printl... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | f4415492ad5e74a763c921f20151dc52 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes |
import java.util.*;
public class CodeForce {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
if(n>1){
String s1="C.",s2=".C";
String a1="",a2="";
for(int i=0;i<n/2;i++){
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | ece48ead81202ef5dc822ae21981d097 | train_000.jsonl | 1390231800 | Iahub likes chess very much. He even invented a new chess piece named Coder. A Coder can move (and attack) one square horizontally or vertically. More precisely, if the Coder is located at position (x,βy), he can move to (or attack) positions (xβ+β1,βy), (xβ1,βy), (x,βyβ+β1) and (x,βyβ1).Iahub wants to know how many Co... | 256 megabytes | import java.util.Scanner;
public class Codeforces {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int n=in.nextInt();
String s="";
String s1="";
System.out.println(((n*n)+1)/2);
for(int i=0;i<n;i++) {
if ((i % 2==0)){
... | Java | ["2"] | 1 second | ["2\nC.\n.C"] | null | Java 8 | standard input | [
"implementation"
] | 1aede54b41d6fad3e74f24a6592198eb | The first line contains an integer n (1ββ€βnββ€β1000). | 800 | On the first line print an integer, the maximum number of Coders that can be placed on the chessboard. On each of the next n lines print n characters, describing the configuration of the Coders. For an empty cell print an '.', and for a Coder print a 'C'. If there are multiple correct answers, you can print any. | standard output | |
PASSED | 1644ffb4570e0864958115e0a86cdc3a | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class GreenHouseEffect {
public static void main (String[]args) throws IOException {
BufferedReader rdr = new BufferedReader(new InputStreamReader(System.in));
String [] input = rdr.readLine().spli... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | 22dfb617f32d69319350738cb97ef511 | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes | import static java.util.Arrays.deepToString;
import java.io.*;
import java.math.*;
import java.util.*;
public class B {
static void solve() {
int n = nextInt();
int m = nextInt();
int[] type = new int[n];
for (int i = 0; i < n; i++) {
type[i] = nextInt();
nextDouble();
}
int[][] d = new int[n + 1]... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | ccb02aad8a210a101ec789f3815826ef | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes | import java.util.*;
import java.io.*;
public class A {
static Scanner sc = new Scanner(System.in);
static int i,j,k,x,n,m;
static int[] dp = new int[10000];
static int[] a = new int[10000];
static double z;
static int f(int k, int j) {
int i;
if (dp[j] >= k) return dp[... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | f1c7a9d998eb2cad094fbb7eee097ad9 | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes | import java.util.Arrays;
import java.util.Scanner;
public class B {
static Scanner in = new Scanner(System.in);
public static void main(String[] args) {
int n = in.nextInt(), m = in.nextInt();
Node[] trees = new Node[n + 1];
trees[0] = new Node();
trees[0].s = 0;
trees... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | cea8bc29884fd70ffd991d489338b6d9 | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes | import java.util.Scanner;
public class B {
static Scanner in = new Scanner(System.in);
public static void main(String[] args) {
int n = in.nextInt(), m = in.nextInt();
int v[] = new int[n+1];
for (int i = 1; i <= n; i++) {
v[i] = in.nextInt();
in.nextDouble();
... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | e0d481add4a6064ccc84cc39681b142a | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 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 | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | 3dbfa17c3b7890baf264f8d0fa81c648 | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes | import static java.lang.Math.*;
import java.io.*;
import java.lang.reflect.*;
public class B {
final int MOD = (int)1e9 + 7;
final double eps = 1e-12;
final int INF = (int)1e9;
public B () {
int N = sc.nextInt();
int M = sc.nextInt();
int [] A = new int[N];
for (int i = 0; i < N; ++i) {
A[i] = sc... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | 18f7650830d0b0044e40ebae03b38c56 | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes | import static java.lang.Math.*;
import java.io.*;
import java.lang.reflect.*;
public class B {
final int MOD = (int)1e9 + 7;
final double eps = 1e-12;
final int INF = (int)1e9;
public B () {
int N = sc.nextInt();
int M = sc.nextInt();
int [] A = new int[N];
for (int i = 0; i < N; ++i) {
A[i] = sc... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | d881cbc802f62e49e2177f36310a744c | train_000.jsonl | 1359732600 | Emuskald is an avid horticulturist and owns the world's longest greenhouse β it is effectively infinite in length.Over the years Emuskald has cultivated n plants in his greenhouse, of m different plant species numbered from 1 to m. His greenhouse is very narrow and can be viewed as an infinite line, with each plant occ... | 256 megabytes |
// @author Sanzhar
import java.awt.Point;
import java.io.*;
import java.util.*;
public class Template {
BufferedReader in;
PrintWriter out;
StringTokenizer st;
String next() {
while (st == null || !st.hasMoreTokens()) {
try {
st = new StringTokenizer(in.readLine()... | Java | ["3 2\n2 1\n1 2.0\n1 3.100", "3 3\n1 5.0\n2 5.5\n3 6.0", "6 3\n1 14.284235\n2 17.921382\n1 20.328172\n3 20.842331\n1 25.790145\n1 27.204125"] | 2 seconds | ["1", "0", "2"] | NoteIn the first test case, Emuskald can replant the first plant to the right of the last plant, so the answer is 1.In the second test case, the species are already in the correct order, so no replanting is needed. | Java 7 | standard input | [
"dp"
] | 32f245fa1a2d99bfabd30b558687ca5f | The first line of input contains two space-separated integers n and m (1ββ€βn,βmββ€β5000, nββ₯βm), the number of plants and the number of different species. Each of the following n lines contain two space-separated numbers: one integer number si (1ββ€βsiββ€βm), and one real number xi (0ββ€βxiββ€β109), the species and position... | 1,700 | Output a single integer β the minimum number of plants to be replanted. | standard output | |
PASSED | cd01b03ba7b7dd1735296e02781884fa | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | /*package com.ashutosh.codeforces;*/
import java.io.*;
import java.util.Arrays;
import java.util.InputMismatchException;
/**
* Created by ashutosh on 12/11/16.
*/
public class b327 extends FastIO{
public static void main(String[] args) {
int n = reader.readInt();
getFirtNPrimeNumbers(n);
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | afad22929e9dc751e31feef687e2f3b9 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | /*package com.ashutosh.codeforces;*/
import java.io.*;
import java.util.Arrays;
import java.util.InputMismatchException;
/**
* Created by ashutosh on 12/11/16.
*/
public class b327 extends FastIO{
public static void main(String[] args) {
int n = reader.readInt();
getFirtNPrimeNumbers(n);
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | a552fa586d30e329ec9eabea35bcdd45 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import org.omg.PortableInterceptor.INACTIVE;
import sun.misc.MessageUtils;
import java.io.*;
import java.math.BigInteger;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.*;
import java.util.zip.DataFormatException;
import static java.lang.Math.min;
public class MyS... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | d05c800fe12f2ad6c4f281d34a5838b8 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes |
import java.util.Scanner;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Vector;
public class Main
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
for(int i=0;i<n;i++)
{
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | ec65cbbc528e9bf0a205ccb2889e6778 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes |
import java.util.Arrays;
import static java.util.Arrays.fill;
import java.util.Scanner;
public class Main
{
public static void main(String args[])throws Exception
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
boolean a[]=new boolean[100000001];
fill(a,false... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 9a689be78f24fe90280d2cb5908db63c | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.Scanner;
public class HungarySequence {
public static void main(String arg[])
{
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
int a[]=new int[n];
int k=0;
int r=1;
for(int i = n; i < (n << 1); i++)
System.out.print(i + " ");
/... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 82eb213732599e1f25847c87622f8022 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.Scanner;
public class hungrySeq {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
for(int i=n;i<2*n;i++)
{
System.out.print(i+" ");
}
}
}
| Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 9092ddc546598e236650328e63139bfc | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main {
// make it false if Multiple test case is not in the question
static boolean multipleTC = false;
int TestCase = 1;
// for pre processing if needed
void pre() throws Exception {
}
public static void mai... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | a3b1ec6c890ad560847c6660a00b0792 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 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.ArrayList;
import java.util.StringTokenizer;
public class Solution {
public static final double eps = 1e-9;
public stati... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 05d7ef33c9b6c38e8bda065997a79798 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.List;
/**
*
*
* @author Code Forces.
*
* Solution by: L.Azuaje.
*
* CF Problem: ... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | b25132d26a01bb7cff9f008e93779ce7 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.*;
public class bucky{
public static void main (String args[]) {
Scanner input=new Scanner(System.in);
HashMap<Integer, Integer> map1= new HashMap<Integer, Integer>();
HashMap<Integer, Integer> map2= new HashMap<Integer, Integer>();
HashMap<String, Integer> scazut= new HashMap<String, Integer>(... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 90de5681705649eaf6ad92d1dd9df9c8 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class CodeForces_327B {
public static void main(String[] args) throws NumberFormatException,
IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
i... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | ec819e87b878810671bba80b7c1e10ee | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;
import java.util.Map.*;
public class j {
public static void prime(int n) {
boolean[] prime = new boolean[100000007];
int count = 0;
StringBuilder sb = new StringBuilder();
for(int i=2;i<100000007;i++) {
if(prime[i]==false) ... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 5c8bd4204ce0d8f7a8c3d377396e464d | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
FastIO io;
// File names!!!
void solve() throws IOException {
int n = io.nextInt();
for (int i = 0; i < n; i++) {
io.print(i + 100001);
io.print(" ");
}
}
vo... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 0237c15e303f6d8d60353dc72d8173eb | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main {
FastIO io;
// File names!!!
void solve() throws IOException {
int n = io.nextInt();
StringBuilder sb = new StringBuilder();
for (int i = 0; i < n; i++) {
sb.append(i + 100001);
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 58f5fde38554e2e802c01c5a6c683acf | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 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;
import java.math.BigInteger;
import java.util.Array... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | ebb9a876691744ef648b4fdfe72fdf69 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 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;
import java.math.BigInteger;
import java.util.Array... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 7cb81e7976264104f86c139682b1a655 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.StringTokenizer;
import java.util.TreeSet;
public class Hungry_Sequence {
// http://codeforces.com/problemset/problem/327/B
public static void main(St... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 615f247e019792475657638da2565fb3 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class Hungry_Sequence
{
public static void main(String args[]) throws Exception
{
BufferedReader f=new BufferedReader(new InputStreamReader(System.in));
int num=Integer.parseInt(f.readLine());
for(int x=0;x<num;x++)
if(x==0)
System.out.prin... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 0f4e75e4aed128d490ce8d24e656dfea | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.Scanner;
public class a2oj {
private static final Scanner scan = new Scanner(System.in);
public static void main(String[] args) {
int n = scan.nextInt();
int[] result = new int[n];
int last = 10000000;
for (int i = n-1; i >= 0; i--) {
result[i] = -... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | e0c1a27379c719d081f4f0044a03fb07 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.io.BufferedWriter;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class HungrySequence {
public static void main(String[] args) {
InputReader in = new InputReader();
Pri... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 15472fbfefdb85c174313739efe3e053 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.Scanner;
public class A327 {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int n = scan.nextInt();
for (int i = n*5; i < n*6; i++) {
System.out.print(i + " ");
}
}
}
| Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | ff43cb135ff7bddfb336ec03ddf05ac9 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes |
import java.util.Scanner;
public class HungrySequence {
public static void main(String[] args) {
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
for(int i=0;i<n;i++) {
System.out.print(2*n+i+" ");
}
}
}
| Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | e7650d28e88918bab350f95844184d6b | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public final class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner sc=new Scanner(System.in);
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 4f8ef034190690c2dba564fe6ff1da91 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.Scanner;
import java.util.Arrays;
import java.io.PrintWriter;
public class Main {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
PrintWriter out = new PrintWriter(System.out);
boolean[] arr = new boolea... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 5979b826b390a7ff11f3be610facf98c | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.Scanner;
import java.util.Arrays;
import java.io.PrintWriter;
public class Main {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
// PrintWriter out = new PrintWriter(System.out);
int n;
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 6d8ebca5bc59588549e4191a999d2f86 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = sc.nextInt();
for(int i = 0; i < n; ++i)
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 8bd03398dd16d0a2e2e551a431332b1e | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
int n = sc.nextInt();
for(int i = 0; i < n; ++i)
... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | ac2e7cca37d762f7b4c7ea4ea93ed796 | train_000.jsonl | 1372941000 | Iahub and Iahubina went to a date at a luxury restaurant. Everything went fine until paying for the food. Instead of money, the waiter wants Iahub to write a Hungry sequence consisting of n integers. A sequence a1, a2, ..., an, consisting of n integers, is Hungry if and only if: Its elements are in increasing order. ... | 256 megabytes | import java.io.*;
import java.util.*;
import static java.lang.Math.sqrt;
public class problem {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
PrintWriter writer = new PrintWriter(new OutputStreamWriter(Sys... | Java | ["3", "5"] | 1 second | ["2 9 15", "11 14 20 27 31"] | null | Java 8 | standard input | [
"math"
] | c047040426e736e9085395ed9666135f | The input contains a single integer: n (1ββ€βnββ€β105). | 1,200 | Output a line that contains n space-separated integers a1 a2, ..., an (1ββ€βaiββ€β107), representing a possible Hungry sequence. Note, that each ai must not be greater than 10000000 (107) and less than 1. If there are multiple solutions you can output any one. | standard output | |
PASSED | 96b1a88801c4dbaa6893c424616f7d5b | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | // #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
public class Main {
static int infi = Integer.MAX_VALUE / 2, mod = (int) (1e9 + 7), maxn = (int) 1e5;
static long infl = Long.... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | 01159c8fd87881063098d68d33e79458 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | import javafx.util.Pair;
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main implements Runnable
{
boolean multiple = true;
long MOD = 1000000007;
@SuppressWarnings("Duplicates")
void solve() throws Exception
{
HashMap<Pair<Integer, Integer>, Integer> m... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | bbbe5ecd2c0b164d7f84e5dbabfd7f44 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | // package com.company;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.lang.reflect.Array;
import java.sql.SQLOutput;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | 53372201c3d21825d5d62d38198cfe51 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | //
import java.math.*;
import java.util.*;
import java.io.*;
public class C {
static BufferedReader in;
static String file = "../in";
static int test = 10; // 0 for local testing, 1 for std input
public static void main(String[] args) throws Exception
{
int _k = Integer.valueOf("1")... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | e50624e15a1e9a0d3ffd24eea300e41f | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes |
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.net.StandardSocketOptions;
import java.security.cert.CollectionCertStoreParameters;
import... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | 5df889de760285f897fa157beda0ab5e | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | import java.io.*;
import java.lang.reflect.Array;
import java.util.*;
import static java.lang.Math.*;
public class Main {
void run() throws IOException {
int t = nextInt();
while (t-- > 0) {
int n = nextInt();
char[] a = next().toCharArray();
TreeMap<pair, Inte... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | 692f9f0272ad6a0af8921aba4c31c3a7 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | // package cp;
import java.io.*;
import java.math.*;
import java.util.*;
public class Cf_three {
long gcd(long a,long b) {if(b==0)return a;else return gcd(b,a%b);}
void swap(long a,long b) {long temp=a;a=b;b=temp;}
StringBuilder sb=new StringBuilder();
BigInteger RES=new BigInteger("0");
//(Initialize as string) ... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | ece41c919b682940b8825ab0e059c259 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | import java.io.*;
import java.math.*;
import java.text.DecimalFormat;
import java.util.*;
public class MainClass
{
InputStream in;
PrintWriter out;
long mod=(long)1e9+7;
int MAX=(int)2e5+7;
double eps=1e-6;
String high="";
void solve()
{
int t = ni();
while(t-- > 0) {
int n = ni();
String pat... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | 8aa37e622c97c2ec216840c8ff994db2 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | import java.util.*;
public final class Second {
static class Point {
int x, y;
Point(int a, int b) {
x = a;
y = b;
}
@Override
public int hashCode() {
return Objects.hash(x, y);
}
@Override
public boolean equals... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | b64bbc032f392d32f91854e7d55127d2 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
private void solve()throws IOException{
int n=nextInt();
HashMap<String,Integer> map=new HashMap<>();
map.put("0 0",0);
int time=1;
int x=0,y=0;
String s=nextLine();
int min=inf;
int l=-1,r... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | 5bd1ae14aea67597367e57c89453a959 | train_000.jsonl | 1580826900 | There is a robot on a coordinate plane. Initially, the robot is located at the point $$$(0, 0)$$$. Its path is described as a string $$$s$$$ of length $$$n$$$ consisting of characters 'L', 'R', 'U', 'D'.Each of these characters corresponds to some move: 'L' (left): means that the robot moves from the point $$$(x, y)$... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.HashMap;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is ... | Java | ["4\n4\nLRUD\n4\nLURD\n5\nRRUDU\n5\nLLDDR"] | 1 second | ["1 2\n1 4\n3 4\n-1"] | null | Java 11 | standard input | [
"data structures",
"implementation"
] | 1fc1d5ee79aaf823b246db5471ba7836 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) β the number of test cases. The next $$$2t$$$ lines describe test cases. Each test case is given on two lines. The first line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) β the length of the robot's path.... | 1,500 | For each test case, print the answer on it. If you cannot remove such non-empty substring that the endpoint of the robot's path doesn't change, print -1. Otherwise, print two integers $$$l$$$ and $$$r$$$ such that $$$1 \le l \le r \le n$$$ β endpoints of the substring you remove. The value $$$r-l+1$$$ should be minimum... | standard output | |
PASSED | 31cccdffd9b92bb1975a1d998a67cdde | train_000.jsonl | 1304485200 | Polycarp thinks about the meaning of life very often. He does this constantly, even when typing in the editor. Every time he starts brooding he can no longer fully concentrate and repeatedly presses the keys that need to be pressed only once. For example, instead of the phrase "how are you" he can type "hhoow aaaare yy... | 256 megabytes | /**
* Mx NINJA
* 01:50:13 Ψ΅
* 21/12/2013
*/
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Stack;
public class Main {
public static void main(String[] args)throws Exception {
BufferedReader reader = new BufferedReader(new InputStreamReader(... | Java | ["hhoowaaaareyyoouu", "reallazy", "abacabaabacabaa"] | 1 second | ["wre", "rezy", "a"] | null | Java 6 | standard input | [
"implementation"
] | 26f1b8c3cb83603c904e1508df4067f4 | The input data consists of a single line to be processed. The length of the line is from 1 to 2Β·105 characters inclusive. The string contains only lowercase Latin letters. | 1,400 | Print the given string after it is processed. It is guaranteed that the result will contain at least one character. | standard output | |
PASSED | 444c78326dc2c4f6ae82b6168e82be9d | train_000.jsonl | 1304485200 | Polycarp thinks about the meaning of life very often. He does this constantly, even when typing in the editor. Every time he starts brooding he can no longer fully concentrate and repeatedly presses the keys that need to be pressed only once. For example, instead of the phrase "how are you" he can type "hhoow aaaare yy... | 256 megabytes |
import java.util.Deque;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author nik
*/
public class Plugin {
public static void main(String[] args) {
Scanner sc... | Java | ["hhoowaaaareyyoouu", "reallazy", "abacabaabacabaa"] | 1 second | ["wre", "rezy", "a"] | null | Java 6 | standard input | [
"implementation"
] | 26f1b8c3cb83603c904e1508df4067f4 | The input data consists of a single line to be processed. The length of the line is from 1 to 2Β·105 characters inclusive. The string contains only lowercase Latin letters. | 1,400 | Print the given string after it is processed. It is guaranteed that the result will contain at least one character. | standard output | |
PASSED | ee56723880c07ec8670cff9747e737e8 | train_000.jsonl | 1304485200 | Polycarp thinks about the meaning of life very often. He does this constantly, even when typing in the editor. Every time he starts brooding he can no longer fully concentrate and repeatedly presses the keys that need to be pressed only once. For example, instead of the phrase "how are you" he can type "hhoow aaaare yy... | 256 megabytes |
import java.util.Deque;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.Scanner;
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author nik
*/
public class Plugin {
public static void main(String[] args) {
Scanner sc... | Java | ["hhoowaaaareyyoouu", "reallazy", "abacabaabacabaa"] | 1 second | ["wre", "rezy", "a"] | null | Java 6 | standard input | [
"implementation"
] | 26f1b8c3cb83603c904e1508df4067f4 | The input data consists of a single line to be processed. The length of the line is from 1 to 2Β·105 characters inclusive. The string contains only lowercase Latin letters. | 1,400 | Print the given string after it is processed. It is guaranteed that the result will contain at least one character. | standard output | |
PASSED | 0167c72a406e1fd733742e037b8b90d9 | train_000.jsonl | 1304485200 | Polycarp thinks about the meaning of life very often. He does this constantly, even when typing in the editor. Every time he starts brooding he can no longer fully concentrate and repeatedly presses the keys that need to be pressed only once. For example, instead of the phrase "how are you" he can type "hhoow aaaare yy... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
char[] a = r.readLine().toCharArray();
char[] b = new char[a.le... | Java | ["hhoowaaaareyyoouu", "reallazy", "abacabaabacabaa"] | 1 second | ["wre", "rezy", "a"] | null | Java 6 | standard input | [
"implementation"
] | 26f1b8c3cb83603c904e1508df4067f4 | The input data consists of a single line to be processed. The length of the line is from 1 to 2Β·105 characters inclusive. The string contains only lowercase Latin letters. | 1,400 | Print the given string after it is processed. It is guaranteed that the result will contain at least one character. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.