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 | 7bb568e337a6b1211315cf39a206ed0e | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import java.util.*;
public class Practica_1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String ln = in.next();
int a = 0, b = 0;
for (int j = 0; j < ln.length(); j++) {
if (ln.charAt(j) == '(') {
a++;
b... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 68d33958156786cfb0549fe41b504d66 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes |
import java.util.*;
public class Practica_1 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
String ln = in.next();
int a = 0, b = 0;
for (int j = 0; j < ln.length(); j++) {
if (ln.charAt(j) == '(') {
a++;
... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 0a81799e7e7994ea8d0625c356865723 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import java.util.*;
import java.io.*;
import java.awt.Point;
import java.math.BigDecimal;
import java.math.BigInteger;
import static java.lang.Math.*;
// Solution is at the bottom of code
public class B implements Runnable{
final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null;
BufferedReader... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 4a70a7619e32d858dfe5574a3dafadbc | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes |
import java.util.Scanner;
import java.util.Stack;
public class B {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
String s = sc.next();
Stack<Character> st = new Stack<Character>();
int ans = 0;
for (int i = 1; i <= s.length(); i++) {
if (s.charAt(i-1) == '('){
st.pus... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 1063787d424f95bedcf6240f04eacf44 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import static java.util.Arrays.deepToString;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Archive {
static int search(int[] a, int i, int key){
int left = i - 1;
int right = a.length;
while(right - left > 1){
int mid = (right + left) / 2;... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | a99f10abbd42bfe3ed463c4de1b2f649 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | // package main;
import java.io.*;
import java.math.*;
import java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.o... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 817d87ad1ebf3eed120bccc64e6ad648 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | // package main;
import java.io.*;
import java.math.*;
import java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.o... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | b1ae165e28a3ae17b44c4851ee942c05 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | // package main;
import java.io.*;
import java.math.*;
import java.util.*;;
/**
* Built using CHelper plug-in
* Actual solution is at the top
* @author Togrul Gasimov
*/
public class Main {
public static void main(String[] args) {
InputStream inputStream = System.in;
OutputStream outputStream = System.o... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 28a3684cbbca50621bc5938ccdd02414 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
public class Bracket {
public static void main(String[] args) {
Stack<String> p = new Stack<String>();
Scanner sc = new Scanner(System.in);
String entry = sc.nextLine();
int ans = entry.length();
for(int i = 0; i < entry.length(); i++) {
if(entry.c... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | af6e47663f259d68004f62241df0adc1 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
public class Task26B {
public static void main(String[] args) throws IOException {
InputStreamReader reader = new InputStreamReader(System.in, Charset.forName("UTF-8"));
int c = -1, opened = 0, total = 0,... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 61c4f94b0abddc77c9159b3a04367fef | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import java.io.InputStream;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.PrintWriter;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.A... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | d042e172143be668e4a86b9a8fa28736 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import java.util.ArrayList;
import java.util.Scanner;
public class Main16 {
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
String s = scan.nextLine();
char[] cad = s.toCharArray();
int count = 0;
ArrayList<Character> stack = new ArrayList<Character>();
for (int i =... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 708fe3213a0da6eaf4c17bd15775065a | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes |
import java.util.Scanner;
public class ACMD {
public static void main(String[] args) {
Scanner sc =new Scanner(System.in);
String str=sc.nextLine();
int rTol=0;
int sum=0;
for(int i=0;i<str.length();i++){
if(str.charAt(i)=='(')
rTol++;
... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | 1019910558c1a370ab20cccd6c435bc9 | train_002.jsonl | 1281970800 | A bracket sequence is called regular if it is possible to obtain correct arithmetic expression by inserting characters «+» and «1» into this sequence. For example, sequences «(())()», «()» and «(()(()))» are regular, while «)(», «(()» and «(()))(» are not.One day Johnny got bracket sequence. He decided to remove some o... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Stack;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author... | Java | ["(()))(", "((()())"] | 5 seconds | ["4", "6"] | null | Java 7 | standard input | [
"greedy"
] | 2ce2d0c4ac5e630bafad2127a1b589dd | Input consists of a single line with non-empty string of «(» and «)» characters. Its length does not exceed 106. | 1,400 | Output the maximum possible length of a regular bracket sequence. | standard output | |
PASSED | b0f20e02a0464303587b55cea31282ed | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes |
import java.math.BigInteger;
import java.util.Scanner;
public class Main {
static BigInteger c(BigInteger n, int m) {
BigInteger a = BigInteger.ONE, b = BigInteger.ONE;
for(int i = 1; i <= m; i ++) {
a = a.multiply(n.subtract(BigInteger.valueOf(i - 1)));
b = b.multiply(BigInteger.valueOf(i));
}
return... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 8e632775357ada12a5835144bd9bb1d3 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.io.*;
import java.util.*;
public class Main{
static int mod = (int)(Math.pow(10, 9) + 7);
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
long n = sc.nextLong();
long sol1 = 0;
... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 5d2d33e72b7c2ddfcfa0e9be0fd69ce8 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | public class f {
public static void main(String[] args) {
long r = new java.util.Scanner(System.in).nextInt()+1;
System.out.println(((((((((((1*(r-1))/1)*(r-2))/2)*(r-3))/3)*(r-4))/4)*(r-5))/5)+((((((((((((1*(r-1))/1)*(r-2))/2)*(r-3))/3)*(r-4))/4)*(r-5))/5)*(r-6))/6)+(((((((((((((1*(r-1))/1)*(r-2))/... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 066516ee035d6cd1a59472717e37f9fd | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.math.BigInteger;
import java.util.Scanner;
public class Personnel {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
System.out.println(BigInteger.ZERO.add(comb(n, 5)).add(comb(n, 6)).add(comb(n, 7)));
}
public static BigInteger comb(long n, lo... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | ead020b965aedb4e2ad8372a9d63d880 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes |
import java.util.*;
public class random_num {
public static void main(String args[]){
Scanner s=new Scanner(System.in);
int n=s.nextInt();
long ans=0;
long temp=1;
for(int i=0;i<7;i++)
{
temp=(temp*(n-i))/(i+1);
if(i>=4)ans+=temp;
}
System.ou... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 87909ae1aae997e9eb119ea468766787 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes |
import java.math.BigInteger;
import java.util.Scanner;
import java.util.Set;
import java.util.TreeSet;
/**
*
* @author Mohammad Hadi
*/
public class F630 {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
System.out.println(c(n, 5).add... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 3370d9ad26d512e709c3dc66dd1eb8cb | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes |
import java.io.*;
import java.util.*;
public class Main {
void solve(Scanner in, PrintWriter out){
long n = in.nextLong();
long a = n / 1 * (n - 1)/2 * (n - 2)/3 * (n - 3)/4 * (n - 4)/5;
long b = n / 1 * (n - 1)/2 * (n - 2)/3 * (n - 3)/4 * (n - 4)/5 * (n - 5) / 6;
long c = n / 1 * (n - 1)... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 494e85e1ca8365be883f21562b6b535b | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes |
import java.io.*;
import java.util.*;
/**
*
* @author Sourav Kumar Paul
*/
public class SolveF {
public static void main(String[] args) throws IOException{
Reader in = new Reader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));
lon... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 42d585b2b2cc19996bd37da6417d25d2 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long n = in.nextLong();
long k5 = n / 1 * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5;
long k6 = k5 * (n - 5) / 6;
long k7 = k6 * (n - 6) / 7;
System.out.println(k5 + k6 + ... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 9ffeafc3092ce6392933ec3e45cf7f26 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.io.PrintWriter;
import java.util.Scanner;
public class Main {
void solve(Scanner in, PrintWriter out) {
long n = in.nextLong();
long ans1 = n / 1 * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5;
long ans2 = n / 1 * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5 * (n - 5) / 6;
long a... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | d8d0ad61e872eb72478dd8ed8054c00e | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.util.*;
import java.io.*;
import java.lang.Math.*;
public class main{
void solve(Scanner in, PrintWriter out){
long n=in.nextInt();
long c_5=n/1*(n-1)/2*(n-2)/3*(n-3)/4*(n-4)/5;
long c_6=c_5*(n-5)/6;
long c_7=c_6*(n-6)/7;
out.println(c_5+c_6+c_7);
}
void run(){
try( Scanner in=new Scanner(S... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 0402056a4a65b5dac13d51438a1c87c4 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.util.*;
import java.io.*;
import java.lang.Math.*;
public class main{
void solve(Scanner in, PrintWriter out){
long n=in.nextLong();
long c_5=n/1*(n-1)/2*(n-2)/3*(n-3)/4*(n-4)/5;
long c_6=c_5*(n-5)/6;
long c_7=c_6*(n-6)/7;
out.println(c_5+c_6+c_7);
}
void run(){
try( Scanner in=new Scanner(... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 13dff513a04afc0ccbb9659cec30a55a | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.math.BigInteger;
import java.util.Scanner;
public class CF_630F {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
BigInteger[] factorials = new BigInteger[10];
factorials[0] = BigInteger.ONE;
for (int i = 1; i < factorials.length; i++) {
factorials[i] = BigIntege... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | c42eef0c19cb987bdde718bd6bc192a1 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.StringTokenizer;
public class Main2 {
public static void main(String[] args) throws IOException {
Scanner sc = new ... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 3511179de9a6b817021130c60d3dabf6 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
long y = 1L*n*(n-1)/2*(n-2)/3*(n-3)/4*(n-4)/5*(n-5)/6*(n-6)/7 + 1L*n*(n-1)/2*(n-2)/3*(n-3)/4*(n-4)/5*(n-5)/6 + 1L*n*(n-1)/2*(n-2)/3*(n-3)/4*(n-4)/5;
System.o... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 8ad9d71200d19c51c6e4edfe942f597d | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class Main {
static BufferedReader in;
static PrintWriter out;
static StringTokenizer buffer;
public static void solve() {
long N = nl();
long x5... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 22210986ff8cf43dea125a1a3184f61a | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.util.*;
public class CodeForces
{
public static void main(String[] args)
{
Scanner in = new Scanner(System.in);
long n = in.nextLong();
long ans = 0;
ans += get_combinatorics(n,5);
ans += get_combinatorics(n,6);
... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 934cd5d509767c90fa2e6e799fa06aa1 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.util.Scanner;
public class codeforces {
public static void main(String[] args) {
TaskF Solver = new TaskF();
Solver.Solve();
}
public static class TaskF {
double tr[][];
public void Solve() {
Scanner in = new Scanner(System.in); ... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | eba72f835f7750860ec78ead472f9b49 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class B {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
StringTokeniz... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | cabfbe6ef2f1d5381c8c5bfa3c52845c | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
import java.math.BigInteger;
import java.util.Scanner;
/**
*
* @author Marwen
*/
public class Main {
static BigInteger fact(int x)... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 8c3502012ab92bcf94634cbe847e6ecd | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.math.BigInteger;
import java.util.*;
public class Test {
private static final Scanner INPUT = new Scanner(System.in);
public static void main(String[] args) {
int num = INPUT.nextInt();
System.out.printf("%s", C(num, 5).add(C(num, 6).add(C(num, 7))).toString(10));
}
priva... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 4fc735386c37bffdbb1ee61a9d198e04 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
public class F630 {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWri... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 019eebda871967df97d742fa77951637 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.io.*;
import java.util.*;
public class Main {
void solve(Scanner in, PrintWriter out) {
long n = in.nextInt();
long c_5 = (n * (n - 1) / 2 * (n - 2) / 3 * (n - 3) / 4 * (n - 4) / 5);
long c_6 = c_5 * (n - 5) / 6;
long c_7 = c_6 * (n - 6) / 7;
out.print(c_5 + c_6 + c_7);
}
void run() {
... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | eb23115a44adc14b60a97c7aadaf3e15 | train_002.jsonl | 1455807600 | One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the n... | 64 megabytes | import java.io.*;
import java.util.*;
public class ForProblems {
Random rnd = new Random();
double binpow(double a, int b) {
if (b == 0)
return 1;
if (b % 2 == 0) {
double x = binpow(a, b / 2);
return x * x;
} else
return binpow(a, b - ... | Java | ["7"] | 0.5 seconds | ["29"] | null | Java 8 | standard input | [
"combinatorics",
"math"
] | 09276406e16b46fbefd6f8c9650472f0 | The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes. | 1,300 | Output one integer — the number of different variants of group composition. | standard output | |
PASSED | 85b6db39c4bbbc9e03d7f902bd8b3cb5 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.*;
import java.util.*;
import java.awt.geom.Line2D;
public class Task5 {
static BufferedReader in;
static PrintWriter out;
static StringTokenizer tok;
public static void main(String[] args) throws IOException {
in = new BufferedReader(new InputStreamReader(System.in));
... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | fa3b58f20f63f1a163209344e1debbce | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.*;
import java.util.*;
import java.awt.geom.Line2D;
public class Task5 {
static BufferedReader in;
static PrintWriter out;
static StringTokenizer tok;
public static void main(String[] args) throws IOException {
in = new BufferedReader(new InputStreamReader(System.in));
... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 1b4d7a73b7d150612f51ff7b286ceef7 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.*;
import java.util.*;
import java.awt.geom.Line2D;
public class Task5 {
static BufferedReader in;
static PrintWriter out;
static StringTokenizer tok;
public static void main(String[] args) throws IOException {
in = new BufferedReader(new InputStreamReader(System.in));
... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 7a01d6c4d6cfd3818e6893cbd05ebc3b | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.stream.Stream;... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 11e75e1a0e7836b49b8bfe077b424cd8 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Random;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | fe81bbbf6a68ca7b27dcd71309083c7a | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Random;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 802ce724cb1cd72276ecd7535879ea59 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.util.*;
import java.io.*;
import java.lang.*;
import java.math.*;
public class C {
public void run() throws Exception {
FastScanner sc = new FastScanner();
int T = sc.nextInt();
while(T-- >0) {
int n = sc.nextInt();
ArrayList<Integer> sticks = new ArrayList<Integer>();
TreeMap<Integer, Inte... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | b061642fd1498125c068154b8c6f9989 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.StreamTokenizer;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;
import java.util.TreeMap;
/*
* 数学题
*/
public class Main{
... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 4313a18d612d0536f69c42e8915fdc23 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes |
import java.io.*;
import java.util.*;
public class C
{
static StringBuilder st = new StringBuilder() ;
public static void main(String[] args) throws Exception
{
Scanner sc = new Scanner();
PrintWriter out = new PrintWriter(System.out);
int TC = sc.nextInt() ;
while(TC -->0)
{
int n = sc.n... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 7f382f8b60aa878f72a002ea5e343401 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.FileReader;
import java.util.Collecti... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 60cf88601c4e4b68835e4a5bc55357d2 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.InputMis... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 46644c517dd12b8e87365663788355d3 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.util.*;
import java.io.*;
public class A
{
public static void main(String ar[]) throws Exception
{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(br.readLine());
StringBuffer sb=new StringBuffer();
fo... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 7cf36f6fc2419519d89c36247b6e3507 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.util.*;
import java.lang.*;
import java.io.*;
public class Codechef
{ static PrintWriter out=new PrintWriter(System.out);static FastScanner in = new FastScanner(System.in);static class FastScanner {BufferedReader br;StringTokenizer stok;FastScanner(InputStream is) {br = new BufferedReader(new InputStr... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 478862df9837271a07f745302cc14be8 | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 256 megabytes | import java.io.*;
import java.util.Iterator;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
public class ExC {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
out = new PrintWriter(new BufferedOutputStream(System.out));
/*Solution starts here*/... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | 03b0df82ca7c9a5a8937066c4d770d8c | train_002.jsonl | 1534602900 | You have $$$n$$$ sticks of the given lengths.Your task is to choose exactly four of them in such a way that they can form a rectangle. No sticks can be cut to pieces, each side of the rectangle must be formed by a single stick. No stick can be chosen multiple times. It is guaranteed that it is always possible to choose... | 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.util.Collections;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.io.InputSt... | Java | ["3\n4\n7 2 2 7\n8\n2 8 1 4 8 2 1 5\n5\n5 5 5 5 5"] | 2 seconds | ["2 7 7 2\n2 2 1 1\n5 5 5 5"] | NoteThere is only one way to choose four sticks in the first list, they form a rectangle with sides $$$2$$$ and $$$7$$$, its area is $$$2 \cdot 7 = 14$$$, perimeter is $$$2(2 + 7) = 18$$$. $$$\frac{18^2}{14} \approx 23.143$$$.The second list contains subsets of four sticks that can form rectangles with sides $$$(1, 2)$... | Java 8 | standard input | [
"greedy"
] | fc54d6febbf1d91e9f0e6121f248d2aa | The first line contains a single integer $$$T$$$ ($$$T \ge 1$$$) — the number of lists of sticks in the testcase. Then $$$2T$$$ lines follow — lines $$$(2i - 1)$$$ and $$$2i$$$ of them describe the $$$i$$$-th list. The first line of the pair contains a single integer $$$n$$$ ($$$4 \le n \le 10^6$$$) — the number of sti... | 1,600 | Print $$$T$$$ lines. The $$$i$$$-th line should contain the answer to the $$$i$$$-th list of the input. That is the lengths of the four sticks you choose from the $$$i$$$-th list, so that they form a rectangle and the value $$$\frac{P^2}{S}$$$ of this rectangle is minimal possible. You can print these four lengths in a... | standard output | |
PASSED | e7e70acd1af2d05e0ef8c425b379076d | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes | import java.util.ArrayList;
import java.util.Scanner;
public class Forgotten_Episode {
public static void main(String args[]) {
Scanner reader = new Scanner(System.in);
int t = reader.nextInt();
boolean[] episode = new boolean[t];
while (t-- > 1)
episode[reader.nextInt... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 9dc9539dbae1d24693dea7263e6ec3c4 | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes | import java.io.*;
import java.util.*;
public class ForgottenEpisode {
static final Scanner in = new Scanner(System.in);
public static void main(String[] args) {
//int t=in.nextInt();
//for (int i=1; i<=t; ++i) {
new Solver();
//}
in.close();
}
static class Solver {
Solver() {
int length = in.next... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 52803559bf7bb2744f561a5b5752bb31 | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes | import java.util.Scanner;
import java.util.*;
public class ayush {
public static void main(String args[])
{
Scanner scan=new Scanner(System.in);
int n=scan.nextInt();
int[]b=new int[n-1];
int []a=new int [n];
for(int i=1;i<n+1;i++)
{
a[i-1]=i;
}
for(int i=0;i<n-1;i++)
{
... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 3b7ad155f16dd3a44d82c91c61cf5039 | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes |
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
public class episodes {
public static void main(String[] args) throws IOException
{
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String s = reader.readLine();
long n = Long.parseLon... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 1bed9c5ebe5bde4aee92e824b2fb02bd | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes | import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;
public class Codeforces {
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
boolean[] series = new boolean[n];
Arrays.fill(series, false);
... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 82547cbc946e9f4ca8e92627ff528a8b | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes |
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class main {
public static void main(String[] args) {
int l,r,k,x=1,b=0,c,d,t,e=0,y,z;
Scanner in=new Scanner(System.in);
t=in.nextInt();
ArrayList<Integer>a =... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 67fdc6549fe9f367e2986330ee7d3e7c | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes | import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class solution {
public static void merge(int arr[], int l, int m, int r) {
int n1 = m - l + 1;
int n2 = r - m;
int L[] = new int[n1];
int R[] = new int[n2];
for (int i = 0; i < n1; ++i)
L[... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 8144f7e9d2b225c60b84821e998e8e2e | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes | import java.util.Scanner;
public class Driver {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
long n = input.nextLong();
long sum = 0;
for (int i = 0; i < n - 1; i++) {
long x = input.nextLong();
sum += x;
}
long sum2 = n * (n + 1) / 2;
System.out.println(sum... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 621b89188b3c0c294e9d96fc1b0b0a1c | train_002.jsonl | 1401809400 | Polycarpus adores TV series. Right now he is ready to finish watching a season of a popular sitcom "Graph Theory". In total, the season has n episodes, numbered with integers from 1 to n.Polycarpus watches episodes not one by one but in a random order. He has already watched all the episodes except for one. Which episo... | 256 megabytes | import java.util.ArrayList;
import java.util.Collections;
import java.util.Scanner;
public class ForgottenEpisode_Mohamed {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
ArrayList<Integer> list = new ArrayList<>();
... | Java | ["10\n3 8 10 1 7 9 6 5 2"] | 1 second | ["4"] | null | Java 11 | standard input | [
"implementation"
] | 0e4ff955c1e653fbeb003987fa701729 | The first line of the input contains integer n (2 ≤ n ≤ 100000) — the number of episodes in a season. Assume that the episodes are numbered by integers from 1 to n. The second line contains n - 1 integer a1, a2, ..., an (1 ≤ ai ≤ n) — the numbers of episodes that Polycarpus has watched. All values of ai are distinct. | 800 | Print the number of the episode that Polycarpus hasn't watched. | standard output | |
PASSED | 83ddc37056a6fd3fa6101f608483bf72 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main {
static class Scan {
private byte[] buf=new byte[1024];
private int index;
private InputStream in;
private int total;
public Scan()
{
in=System.in;
}
public int scan()throws IOExcepti... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | d2c26829f4b88717ef2eaa2cb667f69c | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main {
static class Scan {
private byte[] buf=new byte[1024];
private int index;
private InputStream in;
private int total;
public Scan()
{
in=System.in;
}
public int scan()throws IOExcepti... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 6483303053cc56b44b86698ec827b35f | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
public class Main {
static class Pair {
int l;
int r;
public Pair(int l, int r) {
this.l = l;
this.r = r;
}
}
static void solve6() {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > ... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 5a392dda27a9767c91ad4eaeddded51a | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
public class ConstructingTheArray {
InputStream is;
PrintWriter pw;
String INPUT = "";
long L_INF = (1L << 60L);
void solve() {
int n = ni(), m, idx = 1, l, r;
PriorityQueue<List... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 046490a8a116a0817215bda684dde70d | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
// Compiler version JDK 11.0.2
public class Dcoder
{
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while(t-->0){
int n=sc.nextInt();
Solution sol=new Solution();
sol.solve(n);
sol.getAns();
... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 27380bb4559d35fcbb279982eb6cbc89 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInp... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 5b011eb09c774da94ea4326bd0a3a5f2 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInp... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 94f4e3c08494e34e77c8422bc5cb1b10 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInp... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 00eae2a201657773ff30f9c231de2c45 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInp... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | f30c8dab4cc039cab1eb3934d454304a | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.ObjectInp... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 19a6f26f35ca454a6f2ff273ef3e30b6 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | //package round642;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
import java.util.PriorityQueue;
public class D {
InputStream is;
PrintWriter out;
String INPUT = "";
void ... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 2a717ce595e7507674ab04608bdac7fa | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
public class ConstructArray {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int t = in.nextInt();
while (t-- != 0) {
int n;
n = in.nextInt();
int arr[][] = new int[n + 1][2];
int nd = n;
... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 773569a04998650bd94cd43e9e87c694 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Objects;
import java.util.PriorityQueue;
import java.util.StringTokenizer;
/**
* Problem CF1353D
*/
@SuppressWarnings("unchecked")
public class CF1353D... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 2536d91634960fe85270cab7d17d76e4 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | /*
*created by Kraken on 14-05-2020 at 19:50
*/
//package com.kraken.cf.cf642;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Comparator;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.Queue;
import... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | c17fa53dfb6b6023f74c86b9d299d84f | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.lang.reflect.Array;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Scanner;
import java.util.TreeSet;
public class cf2 {
private static int n;
static class Pair {
public int l;
public int r;
Pair(int x,int ... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | a466c5fd51f81283c1437034d4a1e858 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
import java.util.stream.Collectors;
public class Solution extends Thread {
private static final FastReader scanner = new FastReader();
private static final PrintWriter out = ne... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 2d901e6a4a1831ae77bebd9084bc9feb | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes |
// Imports
import java.util.*;
import java.io.*;
public class D642 {
static class Segment {
public int start;
public int end;
public int size;
public Segment(int s, int e) {
start = s;
end = e;
size = e - s;
}
@... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 5f041ac0a017fb248effdae441c67fee | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
import java.io.*;
public class ConstructingTheArray{
StringTokenizer st;
BufferedReader br;
class Trsup{
Integer l, ind;
Trsup(Integer l, Integer ind){
this.l = l;
this.ind = ind;
}
}
public void construct(Integer l, Integer r, Trsu... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 7cf665239fd27b3e7946e88320dfe5e2 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
import java.io.*;
public class ConstructingTheArray{
StringTokenizer st;
BufferedReader br;
Trsup[] tr;
class Trsup{
Integer l, ind;
Trsup(Integer l, Integer ind){
this.l = l;
this.ind = ind;
}
}
public void construct(Integer l,... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 3d7229cbc5151c3be464f828a967a1d2 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
import java.io.*;
public class ConstructingTheArray{
StringTokenizer st;
BufferedReader br;
class Trsup{
Integer l, ind;
Trsup(Integer l, Integer ind){
this.l = l;
this.ind = ind;
}
}
public void construct(Integer l, Integer r, Trsu... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 8214ca96a50a0830f43bf3868b04e892 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | /*
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Comparator;
*/
import java.io.*;
import java.util.... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 5a1359451f8e48d0147f93637af712bb | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Comparator;
public class D {
public static void main... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 24f1d64c951934a633eeea7c3a0131ea | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Comparator;
public class D {
public static void main(String args[]) {
class FastReader
{
Buffer... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 52a382482b25bb5aba845f2c92bdd58d | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Comparator;
public class D {
public static void main... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | a73f758f0c0ced446ec472e42a4d7e37 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Comparator;
public class D {
public static void main(String args[]) {
class FastReader
{
Buffer... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | f2ddeff0f66470b00795b1b22f5ba2e0 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Comparator;
public class D {
public static void main(String args[]) {
PriorityQueue<int[]> pq = new Priorit... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 7c34ed5278bc1a6ce253552da8aefc3a | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Comparator;
public class D {
public static void main(String args[]) {
class FastReader
{
Buffer... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 5dbe47dd1fca560d97bef7a5c7dcb604 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.*;
import java.util.*;
public class Codechef{
public static void main(String[] args){
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
try{
int testCases = Integer.parseInt(br.readLine());
for(int i=0; i<testCases; i++){
... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | ad632c34416f28ba47e377f4aad0aaec | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
import java.io.*;
public class C1353D1{
static class FastScanner {
BufferedReader br;
StringTokenizer st;
FastScanner(InputStream stream) {
try {
br = new BufferedReader(new
InputStreamReader(stream));
} catch (... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | ca19b7567e8f527d9d71aae294adb698 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
public class p implements Comparable<p>{
int l;
int r;
public int compareTo(p o) {
int s1 = this.r - this.l + 1;
int s2 = o.r - o.l + 1;
if(s2 > s1) {
return 1;
}else if(s1 == s2) {
if(this.l > o.l) {
return 1;
}
return -1;
}
return -1;
}
public static void main(S... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 24c6d59af45c3379eb6ac1bd2b7cb34f | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | // package com.company;
import java.util.*;
import java.io.*;
import java.lang.*;
/*
** @author jigar_nainuji
*/
public class Main{
public static void main(String args[]){
PrintWriter out=new PrintWriter(System.out);
InputReader in=new InputReader(System.in);
TASK solver = new TASK();
... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 4d579f5950bcc7ccf1e1157f0856599d | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.*;
import java.util.*;
public class SolutionB {
public static void main(String[] args) throws Exception {
int tc = scan.nextInt();
for (int i = 0; i < tc; i++) {
solve();
}
out.close();
}
static class Range {
int start;
int end;
... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 845bbdb410d105fbc64fb0bf41f44e30 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.*;
import java.util.*;
public class sol {
InputReader in;
PrintWriter out;
helper_class h;
final long mod=1000000007;
public static void main(String[] args) throws java.lang.Exception{
new sol().run();
}
void run() throws Exception{
in=new InputReader(System.in... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 493037ffda41bacc5871abb1cb5b8cd5 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokeniz... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | e75ad9fef5905c86d6765faf34c31126 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
import static java.lang.Math.*;
public class Solution implements Runnable {
long mod1 = (long) 1e9 + 7;
int mod2 = 998244353;
public void solve() throws Exception {
int t = sc.nextInt();
while (t-- > 0) {
int n=sc.nextInt()... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | fa95be68e7011fc9838ebdbdffb2505a | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.AbstractCollection;
import ja... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 77b2dc9ea496ba9d805831683c34d8a1 | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.PriorityQueue;
import java.io.BufferedWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.AbstractCollection;
import ja... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output | |
PASSED | 25b390f8f94a51b48607a997979066dd | train_002.jsonl | 1589466900 | You are given an array $$$a$$$ of length $$$n$$$ consisting of zeros. You perform $$$n$$$ actions with this array: during the $$$i$$$-th action, the following sequence of operations appears: Choose the maximum by length subarray (continuous subsegment) consisting only of zeros, among all such segments choose the leftm... | 256 megabytes |
import java.util.*;
import java.lang.*;
import java.io.*;
public class HelloWorld {
static FastReader f = new FastReader();
static PrintWriter out = new PrintWriter(System.out);
public static void solve() {
int n = f.nextInt();
PriorityQueue<Pair> pq = new PriorityQueue<>(new cmp());
... | Java | ["6\n1\n2\n3\n4\n5\n6"] | 1 second | ["1 \n1 2 \n2 1 3 \n3 1 2 4 \n2 4 1 3 5 \n3 4 1 5 2 6"] | null | Java 11 | standard input | [
"data structures",
"constructive algorithms",
"sortings"
] | 25fbe21a449c1ab3eb4bdd95a171d093 | The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 10^4$$$) — the number of test cases. Then $$$t$$$ test cases follow. The only line of the test case contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the length of $$$a$$$. It is guaranteed that the sum of $$$n$$$ over all test cases... | 1,600 | For each test case, print the answer — the array $$$a$$$ of length $$$n$$$ after performing $$$n$$$ actions described in the problem statement. Note that the answer exists and unique. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.