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 | 714729935b3389b203e019e6c8024aff | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.*;
import java.util.*;
import java.lang.*;
public class Santosh{
public static void main(String[] args)throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int t=Integer.parseInt(br.readLine());
while(t-->0){
int n=I... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 726449ece8e018362d36780f844f7b48 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | //package com.company;
import java.io.BufferedReader;
import java.io.*;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.*;
public class solution {
BufferedReader br;
PrintWriter out;
private void solve() {
int t = ni();
while(t-- > 0) {
int n = ni();
... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 207399843cc3574f0747acab3b14870a | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | /*
Author: Anthony Ngene
Created: 28/09/2020 - 05:19
*/
import java.io.*;
import java.util.*;
public class C {
// checks: 1. edge cases 2. overflow 3. possible errors (e.g 1/0, arr[out]) 4. time/space complexity
void solver() throws IOException {
int cases = in.intNext();
for (int t ... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 4499fd677b1296d643b1b7e386d38e61 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | /*
Author: Anthony Ngene
Created: 28/09/2020 - 05:19
*/
import java.io.*;
import java.util.*;
public class C {
// checks: 1. edge cases 2. overflow 3. possible errors (e.g 1/0, arr[out]) 4. time/space complexity
void solver() throws IOException {
int cases = in.intNext();
for (int t ... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 09d809ba3ab31400bb17a26fdfccafc1 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
public class C {
public static void main(String[] args) throws Exception {
FastScanner sc = new FastScanner();
FastWriter writer = new FastWriter();
int t = sc.nextInt();
while (t-- > 0) {
int n ... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | ae2c81b766e166663020071d75f0e136 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | /** */
import java.io.*;
import java.util.*;
import java.text.*;
import java.lang.*;
import java.math.*;
public class Main{
/*********************************************Constants***********************************/
static PrintWriter out=new PrintWriter(new OutputStreamWriter(System.out)); ... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 81d96461a7e82662bdec0b22b9825107 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.util.*;
import java.io.*;
public class C {
static FastReader f = new FastReader();
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) {
int t = f.nextInt();
while(t-- > 0)
solve();
out.close();
}
static void solve() {
int n = f.nextInt();
int[... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | b95c82ca04debab1d3f56b2395e722fa | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class D{
private static FastScanner fs = new FastScanner();
private static PrintWriter out = new P... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 702a6f754ce528ec3be907f79d499212 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
public class C{
private static FastScanner fs = new FastScanner();
public static void main(String[] args)... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 54818f72ccdafe7ca4d9368c7f640aa0 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | // package cf.cf1417;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
import java.util.function.IntConsumer;
public class CFC {
private static final String INPUT = "3\n" +
"5\n" +
"1 2 3 4 5\n" +
... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | e4029f9db683c1007d0bb2dd6a64a9de | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.util.*;
import java.io.*;
public class C
{
public static void main(String args[]) throws IOException
{
// BufferedReader br = new BufferedReader(new FileReader("input.txt"));
// BufferedWriter bw = new BufferedWriter(new FileWriter("output.txt"));
BufferedReader br = new BufferedReader(new InputStr... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 50f88932666c3d36519ecff4a88c608b | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main
{
public static void main(String args[])throws Exception
{
Reader sc=new Reader();
PrintWriter out=new PrintWriter(System.out);
int t=sc.nextInt();
while(t-->0)
{
int n=sc.nextInt();
int arr[]... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | c5600bcea1b6a35758dc30d37f94bcfd | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
static ArrayList<Integer> adj[];
static int k;
static int[] a;
static int b[];
static int m;
static class Pair implements Comparable<Pair> {
int c;
int d;
public Pair(int b, int l) {
c = b;
d = l;
}
@Override
public int compareTo(Pair ... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 1e686092fda0cd9d2ed1bfde13a05755 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.*;
import java.util.*;
public class d2prac implements Runnable
{
private boolean console=false;
public void solve()
{
int i; int n=in.ni(); int a[]=new int[n];
ArrayList<Integer> ans[]=new ArrayList[n];
for(i=0;i<n;i++) ans[i]=new ArrayList();
for(i=0;i<n;i++)
{
a[i]=in.ni()-1; ans[a[i... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | aadd5d89ac99fa21302459d0cbda501d | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.util.*;
import java.util.function.Function;
import java.util.stream.Collectors;
import java.io.*;
import java.math.*;
public class Main7{
static public void main(String args[])throws IOException{
int tt=i();
StringBuilder sb=new StringBuilder();
for(int ttt=1;ttt<=tt;ttt++){
int n=i();
int[] ... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | c9121dbdbb8edf880a0cbe1c1e530a62 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.util.*;
public class C {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int testCases = sc.nextInt();
StringBuilder sb = new StringBuilder();
for (int t = 0; t < testCases; t++) {
int n = sc.nextInt();
int arr[] = n... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 04f91460c49eda5b2dcb3cc53da17596 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
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.uti... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 85650c7ff5874b193712a9fd362e2fc5 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 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.Scanner;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author sofiane
*/
public class Main {
public static void main(String[] args... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | c5517cd54a1d1b59d6a7d7b27d4d45fe | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | import java.io.*;
import java.util.*;
public class A
{
static int n;
static int[] arr;
static char[] s;
public static void main(String[] args) throws IOException
{
Flash f = new Flash();
int T = f.ni();
for(int tc = 1; tc <= T; tc++){
n = f.ni(); arr = f... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | d4a3f5dfb25f2fdf3283a2a0f4819599 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | // package cp;
import java.util.*;
import java.io.*;
import java.math.*;
public class Cp_2 {
BigInteger bi1=new BigInteger("2");//initialize as string
// 1.BigInteger bi=new BigInteger(Readers.next());- take input as biginteger
StringBuilder sb=new StringBuilder();
// 2.StringBuilder temp=new StringBuilder(str[i-1]... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | c93d5e5da31c047487583cc37e26c365 | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes | // package cp;
import java.util.*;
import java.io.*;
import java.math.*;
public class Cp_2 {
BigInteger bi1=new BigInteger("2");//initialize as string
// 1.BigInteger bi=new BigInteger(Readers.next());- take input as biginteger
StringBuilder sb=new StringBuilder();
// 2.StringBuilder temp=new StringBuilder(str[i-1]... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 0d9ebc207f75102f5a1eaf40f4167d8b | train_002.jsonl | 1601219100 | You are given an array $$$a$$$ consisting of $$$n$$$ integers numbered from $$$1$$$ to $$$n$$$.Let's define the $$$k$$$-amazing number of the array as the minimum number that occurs in all of the subsegments of the array having length $$$k$$$ (recall that a subsegment of $$$a$$$ of length $$$k$$$ is a contiguous part o... | 256 megabytes |
import java.io.*;
import java.util.ArrayList;
import java.util.Collections;
public class competetive {
static class pair implements Comparable <pair>{
int f;
int s;
pair(int a , int b){
this.f=a;
this.s=b;
}
int getF(){
return f;
... | Java | ["3\n5\n1 2 3 4 5\n5\n4 4 4 4 2\n6\n1 3 1 5 3 1"] | 1 second | ["-1 -1 3 2 1 \n-1 4 4 4 2 \n-1 -1 1 1 1 1"] | null | Java 11 | standard input | [
"data structures"
] | b7abfb1103bb1796c8f89653c303d7dc | The first line contains one integer $$$t$$$ ($$$1 \le t \le 1000$$$) — the number of test cases. Then $$$t$$$ test cases follow. The first line of each test case contains one integer $$$n$$$ ($$$1 \le n \le 3 \cdot 10^5$$$) — the number of elements in the array. The second line contains $$$n$$$ integers $$$a_1, a_2, \d... | 1,500 | For each test case print $$$n$$$ integers, where the $$$i$$$-th integer is equal to the $$$i$$$-amazing number of the array. | standard output | |
PASSED | 58fda60c367af915e6b395ebe280a7c2 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 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.util.HashMap;
import java.util.Scanner;
/**
*
* @author kacho
*/
public class prob4c {
public static void mai... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | ebf2aee0e8a47374e517e4508e38f63b | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes |
import java.util.*;
public class MyClass {
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
HashMap<String, Integer> l1 = new HashMap<String, Integer>();
String str="";
String str1="";
int k=0;
while(t-->=1)
{
... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | d04f38916d1afd25818cc125317bb2b9 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
public class practice {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int test = sc.nextInt();
HashMap<String,Integer> map = new HashMap<>();
while(test-- > 0){
String str = sc.next();
if(!map.containsKey(st... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | d2419fa0554f81ab964285dd824f4bad | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes |
import java.util.*;
import java.io.*;
public class Registrationsystem {
public static void main(String[] args) throws IOException, FileNotFoundException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
//BufferedReader in = new BufferedReader(new FileReader("Registrationsystem.in"));
... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | d37bc97079e781966b9863a01e0e36f5 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Solution {
static Scanner in = new Scanner(System.in);
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) {
solve();
out.close()... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 9575acd231046c058203088a9826c660 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.io.PrintWriter;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Scanner;
public class Solution {
static Scanner in = new Scanner(System.in);
static PrintWriter out = new PrintWriter(System.out);
public static void main(String[] args) {
solve();
out.close()... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 88941587972d8e3bacc448f23dcfa07b | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
import java.lang.*;
public class Main
{
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
HashMap<String, Integer> h = new HashMap<>();
List<String> l = new ArrayList<>();
for(int i=0;i<n;i++)
{
String s = sc.next();
if(h.containsK... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 0ffe4e4ee091def10870b816c7e1bdc2 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import static java.lang.Math.*;
public class Main implements Runnable {
static class InputReader {
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
private int numCh... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | ada4fdb816f1b31080e9d41845946fd5 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
public class S {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
String str;
HashMap<String,Integer> user = new HashMap<String,Integer>();
while(n-->0) {
str = in.next();
if(!user.containsKey(str)) {
System.out.print... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | e826334267480b37021964e1d8853ed3 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
Map<String,Integer> map = new HashMap<>();
int n = scanner.nextInt();
scanner.nextLine();
while (n... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | ca70b1b2003dc021d867b077719558d7 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.HashMap;
import java.util.Scanner;
public class RegistrationSystem {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int l=in.nextInt();
HashMap<String,Integer>
map=new HashMap();
String s;
for(... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 1aaa5f1d83188feba27fcc401f2f7378 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
public class Main {
public static void main(String[] args) throws IOException {
InputStreamReader reader = new InputStreamReader(System... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | d869cd23b9bbf2d057300a58c7dff9ef | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.TreeSet;
public class RegistrationSystem_4C {
public static void main(String[] args) {
try {
BufferedReader reader = new BufferedRe... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 51db69f9d312032b702b0d6923f7d938 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
public class Solution{
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
HashMap<String,Integer> database=new HashMap<>();
for(int i=0;i<n;i++){
String s=sc.next();
if(database.containsKey(s)){
... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | c1f8f300a6c6bdc4d076cc9ee9e48d23 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
public class c4 {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
HashMap<String,Integer> a=new HashMap<>();
int n=sc.nextInt();
String s=sc.nextLine();
for(int i=0;i<n;i++)
{
s=sc.nextLine();
in... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 01ccd15de7d4e45c1a4b4500025515ae | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | // Java program to illustrate
// Java.util.HashMap
import java.util.*;
import java.io.BufferedInputStream;
public class Q_4C {
public static void main(String[] args) {
Scanner sc = new Scanner(new BufferedInputStream(System.in));
int n = Integer.valueOf(sc.nextLine());
String input;
... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 04950930a564c301a7d14bbe5be8429d | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
import java.io.*;
public class Q_4C {
// -----------PrintWriter for faster output---------------------------------
public static PrintWriter out;
// -----------MyScanner class for faster input----------
public static class MyScanner {
BufferedReader br;
StringToken... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 94df5dd9621f2c964bf45943cac38eee | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
import java.io.*;
public class template {
//-----------PrintWriter for faster output---------------------------------
public static PrintWriter out;
//-----------MyScanner class for faster input----------
public static class MyScanner {
BufferedReader br;
String... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 877b3153102a0e0a87e2ac8e804a85b4 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.Scanner;
import java.util.HashMap;
public class RegistrationSystem{
public static void main(String[] args){
Scanner in = new Scanner(System.in);
long n = in.nextLong();
HashMap<String, Integer> userNames = new HashMap<>();
String inputtedUsername;
while(n-->=1){
inputtedU... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 0719fdd8dc18019f0046bf4e55412092 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
public class Contest{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
HashMap<String, Integer> h = new HashMap<>();
while(n-- > 0){
String s = sc.next();
if(h.containsKey(s)){
... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 885afa5f3d2698da0d12f9f92ccf8e93 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes |
import java.util.*;
public class RegistrationSystem {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
String str;
HashMap<String, Integer> map = new HashMap<>();
while (n-- > 0) {
str = sc.next();
if (map.containsKey(str)) {
int old = map.get... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 4fcce251faaa62b7c0b9f607892da14b | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class registrationSystem {
private static Scanner s = new Scanner(System.in);
public static void main(String[] args) {
int n = s.nextInt(); s.nextLine();
Map<String,Integer> user = new HashMap<>();
String... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 5d24f0ca59361b3393804783afc404ad | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
public class regis {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
HashMap <String, Integer> user = new HashMap<String, Integer>();
for (int i = 0; i < n; i++) {
String a = in.next();
if(user.containsKey(a)){
... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | d7abce78669d493b016bfc8e5659d245 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;
public class RegistrationSystem
{
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | ebf0ca04dba83aa27cb376171fd4a553 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Scanner;
public class RegistrationSystem4C1 {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
int quantity = scanner.nextInt();
String[] names = new String[quantity];
for (in... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 52dabdd8f6b4660fe4f850abcda59dd1 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes |
import java.util.*;
public class RegistrationSystem {
public static void main (String[] args){
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
Map<String,Integer> names = new HashMap<>(n);
while(n-->0){
String name = scanner.next();
int... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 4d42b95541efd0b82b7758af6ecc38ba | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.io.*;
import java.util.*;
public class regsystem {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
HashMap<String,Integer> hm = new HashMap<String,Integer>();
int n = Integer.parseInt(br.readLin... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | fad8f5c78b2cc62247dadd0dbec25e80 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;
public class RegistrazioniConMappa
{
public static void main(String[] args)
{
Scanner tastiera = new Scanner(System.in);
int lunghezza = Integer.parseInt(tastiera.nextLine());
Map<String, Integer> nomi = new HashMap<String, Integer>()... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 29bf26e95e26860d85b5e582ea662750 | train_002.jsonl | 1268395200 | A new e-mail service "Berlandesk" is going to be opened in Berland in the near future. The site administration wants to launch their project as soon as possible, that's why they ask you to help. You're suggested to implement the prototype of site registration system. The system should work on the following principle. E... | 64 megabytes | import java.util.*;
public class registrationsystem
{
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
long n = s.nextLong();
String input = new String();
Map<String, Integer> names = new HashMap<String, Integer>();
for (int i = 0;... | Java | ["4\nabacaba\nacaba\nabacaba\nacab", "6\nfirst\nfirst\nsecond\nsecond\nthird\nthird"] | 5 seconds | ["OK\nOK\nabacaba1\nOK", "OK\nfirst1\nOK\nsecond1\nOK\nthird1"] | null | Java 11 | standard input | [
"data structures",
"implementation",
"hashing"
] | 24098df9c12d9704391949c9ff529c98 | The first line contains number n (1 ≤ n ≤ 105). The following n lines contain the requests to the system. Each request is a non-empty line, and consists of not more than 32 characters, which are all lowercase Latin letters. | 1,300 | Print n lines, which are system responses to the requests: OK in case of successful registration, or a prompt with a new name, if the requested name is already taken. | standard output | |
PASSED | 6af56a58f2943d09bd1ad47012e2e8bc | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
import java.awt.geom.*;
public class FunctionHeight {
public static void main(String[] args) {
MyScanner sc = new MyScanner();
long n = sc.nl();
long k = sc.nl();
long ans = (n+k-1)/n;
System.out.println(ans);
}
... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | b7b149366ccf1a03e4d39adae2f85c43 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner sc=new Scanner(System.in);
long n=sc.nextLong();
long k=sc.nextLong();
if(k%n==0)
System.out.println(k/n);
else
System.out.println(k/n+1);
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | b70cc67073225c0c4fad10e3b324dd31 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
public class FunctionHeight {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
StringTokenizer st ... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 66943d8f3f9815e650fabb4440cc6692 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.util.stream.IntStream;
public class DeathNote {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 34a971c34a2d98a4eadc8d2f3dce6f96 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.*;
public class a{
public static void main(String args[]){
Scanner s = new Scanner(System.in);
long n = s.nextLong();
long k = s.nextLong();
long temp = k/n;
if (k%n != 0) temp++;
System.out.println(temp);
}
} | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | a6ec576e976f347ed927e160953b1548 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes |
import java.util.Scanner;
public class ques1 {
public static void main(String args[])
{
Scanner sc=new Scanner(System.in);
long n,k ;
n=sc.nextLong();
k=sc.nextLong();
if(k%n!=0)
System.out.println(k/n+1);
else
System.out.println(k/n);
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 3e807ea81a863aa4f020d5055bdb1fee | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes |
import java.io.*;
//import java.text.DecimalFormat;
import java.util.*;
public class Main {
static InputReader in;
static PrintWriter out;
public static void main(String args[] ) {
InputReader in = new InputReader(System.in);
PrintWriter out = new PrintWriter(System.out);
//Scanner... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 00fad224fc5ba0713eff88c2fc0d47fd | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.*;
import java.lang.*;
import java.io.*;
public class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
Scanner in = new Scanner(System.in);
long n=in.nextLong();
long k=in.nextLong();
if(k%n==0){
System.out.println(k/n);
}
else{
System.out.printl... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 630589785fdeb2bf7de41e3e283795a3 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
import java.util.regex.*;
public class Solution
{
static class InputReader
{
private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
public InputReader(InputStream s... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 2f7d058b9af19912c9feff251a3228cc | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
public class zizo {
public static void main(String[]args) throws IOException {
Scanner zizo = new Scanner(System.in);
PrintWriter wr = new PrintWriter(System.out);
long n ... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | b6ba97055c17de34c03e46fc313d2f63 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.*;
public class CodeforcesFunctionHeight {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
long n = in.nextLong();
long k = in.nextLong();
long ans = (k%n == 0) ? k/n : k/n + 1;
System.out.println(ans);
in.close();
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 46d065254bb4fec8c80bbd0939f1ef3c | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
InputStream inputStream = System.in;
OutputStream outputStream = System.out;
PrintWriter out = new PrintWriter(outputStream);
InputReader in = new InputReader(inpu... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | ed86d0fa1876b176268b74600dae33c3 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes |
import java.io.*;
import java.util.*;
public class A {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
String[] s = br.readLine().trim().split(" ");
long n = Long.parseLong(s[0... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 0aa461c03f8bf279461e8992fb594814 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.MathContext;
import java.util.StringTokenizer;
public class codeforces3 {
public static void main(String[] args) throws IOException {
Buffe... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 84b2a502b450601e2483cfbc45988f02 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes |
import java.io.IOException;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.math.RoundingMode;
import java.util.Scanner;
public class Function {
public static Integer[] getArray(int size) {
Integer[] array = new Integer[size];
for (int i = 0; i < size; i++) {
array[i] = sr.nextInt();
... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 46fd7a837066147f7fb01f62585d63b3 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.Scanner;
public class A {
public static void main(String[] args) {
Scanner console = new Scanner(System.in);
long n = console.nextLong();
long k = console.nextLong();
System.out.println((long) (((k - 1) / n + 1)));
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 65ad5a2b9b47ad68243d9c10c026067b | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.io.InputStream;
/**
* @author khokharnikunj8
*/
public class Main {
public static void main(String[] args) {
... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | eaa1198143dc76247d04436d717bf754 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.Scanner;
public class Main{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
long x = scan.nextLong();
long y = scan.nextLong();
long z = y/x ;
if(y%x != 0){
z++;
}
System.out.println(z);
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | ac7751cb092a435aa6f6416f5b1139e2 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.Scanner;
public class Triangle {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scan = new Scanner(System.in);
long n = scan.nextLong();
long k = scan.nextLong();
long x = (n + k - 1)/n;
System.out.println(x);
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 2cbfc1b118c944115ca520bc7ad8bee6 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.*;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.*;
public class Solu {
static StringBuffer str = new StringBuffer();
static InputReader in = new InputReader(System.in);
static int mm=1000000007;
public static void main(String[] args) {
int... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 10eb713f7d3e034c82835ce5871a753f | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.DataInputStream;
import java.io.IOException;
public class Main {
public static void main(String... args) throws IOException {
Reader reader = new Reader();
long n = reader.nextInt();
long k = reader.nextInt();
System.out.println(-Math.floorDiv(-k, n));
}
st... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 7b0e8ab37755d3c59a09c8206c95180c | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.DataInputStream;
import java.io.IOException;
public class R50PA {
public static void main(String... args) throws IOException {
Reader reader = new Reader();
long n = reader.nextInt();
long k = reader.nextInt();
System.out.println(-Math.floorDiv(-k, n));
}
s... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 18899f33ad3f5f875f1951a3e98d6d1f | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;
public class EDUA50 {
public static void main(String[] args) {
Scanner s = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
long n = s.nextLong();
long k = s.nextLong();
if (k <= n) {
System.out.pr... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 5c39c924ae98ccb39a8d6379250e634d | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class Main
{
static long mod=1000000007;
public static void main(String[] args) throws IOException
{
FastReader in=new FastReader();
PrintWriter pw=new PrintWriter(System.out);
long n=in.nextLong();
long k=in.nextLong();
long ans=k/... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 33e2f7689b0d558d3064a5850eacd592 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.Scanner;
public class FunctionalHeights {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner input = new Scanner(System.in);
long n = input.nextLong();
long k = input.nextLong();
//long i = n;
//int j = 1;
Syst... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | b9f5f83c1c269e1caf3f0de3bd8c6f7e | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
public class EDU_50 {
static Reader r = new Reader();
static PrintWriter out = new PrintWriter(System.out);
private static long binarySearch(long n, long k) {
long ans = Long.MAX_VALUE;
lon... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 6806e6a53541c82e9095b3549bf675f9 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args)
{
InputReader in = new InputReader(System.in);
OutputWriter out = new OutputWriter(System.out);
long n = in.nextLong();
long m = in.nextLong();
if (m%n==0)
out... | Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | f33def517f44414ad0abb53f3ec7b9d2 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.Scanner;
public class App {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
long n = sc.nextLong(),k = sc.nextLong();
System.out.print((n + k - 1) / n);
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | c2e5134a797f31a09d9156b24110522c | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.Scanner;
public class A {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
long n = in.nextLong();
long k = in.nextLong();
System.out.println((k - 1)/n + 1);
in.close();
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | d07d6c24bcad65d2ab1edba66eb66d60 | train_002.jsonl | 1536330900 | You are given a set of $$$2n+1$$$ integer points on a Cartesian plane. Points are numbered from $$$0$$$ to $$$2n$$$ inclusive. Let $$$P_i$$$ be the $$$i$$$-th point. The $$$x$$$-coordinate of the point $$$P_i$$$ equals $$$i$$$. The $$$y$$$-coordinate of the point $$$P_i$$$ equals zero (initially). Thus, initially $$$P_... | 256 megabytes | import java.util.Scanner;
public class A {
public static void main(String[] args) throws Exception {
Scanner in = new Scanner(System.in);
long n = in.nextLong();
long k = in.nextLong();
long ans = (long) ((k - 1)/n);
System.out.println(ans + 1);
in.close();
}
}
| Java | ["4 3", "4 12", "999999999999999999 999999999999999986"] | 1 second | ["1", "3", "1"] | NoteOne of the possible answers to the first example: The area of this plot is 3, the height of this plot is 1.There is only one possible answer to the second example: The area of this plot is 12, the height of this plot is 3. | Java 8 | standard input | [
"math"
] | 31014efa929af5e4b7d9987bd9b59918 | The first line of the input contains two integers $$$n$$$ and $$$k$$$ ($$$1 \le n, k \le 10^{18}$$$) — the number of vertices in a plot of a piecewise function and the area we need to obtain. | 1,000 | Print one integer — the minimum possible height of a plot consisting of $$$2n+1$$$ vertices and with an area equals $$$k$$$. It is easy to see that any answer which can be obtained by performing moves described above always exists and is an integer number not exceeding $$$10^{18}$$$. | standard output | |
PASSED | 0f1e18be7a0dba52421e29ca32c8c51b | train_002.jsonl | 1324728000 | Vera adores poems. All the poems Vera knows are divided into quatrains (groups of four lines) and in each quatrain some lines contain rhymes.Let's consider that all lines in the poems consist of lowercase Latin letters (without spaces). Letters "a", "e", "i", "o", "u" are considered vowels.Two lines rhyme if their suff... | 256 megabytes | import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;
public class cf138a {
public static void main(String[] args) {
... | Java | ["1 1\nday\nmay\nsun\nfun", "1 1\nday\nmay\ngray\nway", "2 1\na\na\na\na\na\na\ne\ne", "2 1\nday\nmay\nsun\nfun\ntest\nhill\nfest\nthrill"] | 2 seconds | ["aabb", "aaaa", "aabb", "NO"] | NoteIn the last sample both quatrains have rhymes but finding the common scheme is impossible, so the answer is "NO". | Java 7 | standard input | [
"implementation",
"strings"
] | a17bac596b1f060209534cbffdf0f40e | The first line contains two integers n and k (1 ≤ n ≤ 2500, 1 ≤ k ≤ 5) — the number of quatrains in the poem and the vowel's number, correspondingly. Next 4n lines contain the poem. Each line is not empty and only consists of small Latin letters. The total length of the lines does not exceed 104. If we assume that the ... | 1,600 | Print the rhyme scheme of the poem as "aabb", "abab", "abba", "aaaa"; or "NO" if the poem does not belong to any of the above mentioned schemes. | standard output | |
PASSED | 65be1e59fad1a6aba0eae26a183866bf | train_002.jsonl | 1316098800 | A company has n employees numbered from 1 to n. Each employee either has no immediate manager or exactly one immediate manager, who is another employee with a different number. An employee A is said to be the superior of another employee B if at least one of the following is true: Employee A is the immediate manager o... | 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 | ["5\n-1\n1\n2\n1\n-1"] | 3 seconds | ["3"] | NoteFor the first example, three groups are sufficient, for example: Employee 1 Employees 2 and 4 Employees 3 and 5 | Java 11 | standard input | [
"dfs and similar",
"trees",
"graphs"
] | 8d911f79dde31f2c6f62e73b925e6996 | The first line contains integer n (1 ≤ n ≤ 2000) — the number of employees. The next n lines contain the integers pi (1 ≤ pi ≤ n or pi = -1). Every pi denotes the immediate manager for the i-th employee. If pi is -1, that means that the i-th employee does not have an immediate manager. It is guaranteed, that no employ... | 900 | Print a single integer denoting the minimum number of groups that will be formed in the party. | standard output | |
PASSED | 3384f666925ea87bc6a59501bf97bc5e | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
public class Main implements Runnable
{
static class InputReader
{
private InputStream stream;
private byte[] buf = new byte[1024];
private int curChar;
... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 5c46006618186cf01e3d275a83474653 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class CF282C {
static BufferedReader __in;
static PrintWriter __out;
static StringTokenizer input;
public static void main(String[] args) throws IOException {
__in = new BufferedRead... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | d3aceae7d8aa24bf3d576f2c9aaf1b22 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.InputStreamReader;
import java.io.InputStream;
/**
* Built using CHelp... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | ce8249913bbf0001d04b126a50c0cf2c | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.*;
import java.util.Queue;
import java.ut... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 8d1e2802e2a18a4255e777fe7d88b3be | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes |
/**
* @author egaeus
* @mail sebegaeusprogram@gmail.com
* @veredict Not sended
* @url <https://codeforces.com/problemset/problem/282/C>
* @category ?
* @date 1/07/2020
**/
import java.io.*;
import java.util.*;
import java.util.stream.Collectors;
import static java.lang.Integer.*;
import static java.lang.Math.... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | f62c3bdad4f64253002682901df15844 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.*;
import java.util.*;
import static java.lang.Math.*;
import static java.util.Arrays.*;
public class cf282c {
public static void main(String[] args) throws IOException {
char[] s1 = rcha(), s2 = rcha();
int n1 = s1.length, n2 = s2.length;
boolean zero1 = true, zero2 = true... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | ef8d51f353e55aac5c3c4207dd8bd880 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.*;
public class Q1
{
public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String s1=br.readLine();
String s2=br.readLine();
if(s1.length()!=s2.length())
System.out.println("NO");
... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 3476dca76be70f4d4b722a8dfc98b517 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import javax.swing.*;
import java.io.*;
import java.math.BigInteger;
import java.util.*;
public class Main {
static PrintWriter out = new PrintWriter(System.out);
static int[] tree;
static long m = 1000000007;
public static void main(String[] args) throws IOException {
//BufferedReader reader=... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | c0ec4dbdfa352b4b48e7b24bec835f60 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.IOException;
import java.util.*;
public class Main {
public static void main(String[] args) throws IOException {
Scanner s = new Scanner(System.in);
StringBuilder sb=new StringBuilder();
char[] a=s.next().toCharArray();
char[] b=s.next().toCharArray();
if(a.length... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 246f4b38afaf163303a4b1aff8f990c9 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | //I AM THE CREED
/* package codechef; // don't place package name! */
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;
public class HelloWorld{
public static void main(String[] args) throws IOException
{
... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | b75484f948a27f559c63899cf9e5bcfd | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class XORandOR {
public static void main(String[] args) throws IOException {
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
String a = bf.readLine();
String b = bf.... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | fdaa1ad31b2319e53792637a63f3d473 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Demo
{
static class FastReader{
BufferedReader br;
StringTokenizer st;
public FastReader(){
... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 4eef3c2368d408039cbfb2384441aa93 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 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.*;
public class Main {
static int log(int n){
int ans=0;
while (n>0){
... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 97a9a808833268ddb949aabdade1abcb | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
String str1 = s.next();
String str2 = s.next();
if(str1.length()!=str2.length()){
System.out.println("NO");
return;
}
boolean... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 3b790442f6b95919b83fddd6844f5c98 | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s = new Scanner(System.in);
String str1 = s.next();
String str2 = s.next();
if(str1.length()!=str2.length()){
System.out.println("NO");
return;
}
boolean a... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | 4942c96bc5026cc9908d6d497ab2408a | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
String a=in.next();
String b=in.next();
if (a.length()!=b.length()){
System.out.println("NO");
}
else{
boolean o=false;
boolean t=false;
for (char temp:a.toCharArray()){... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output | |
PASSED | d70f9d8af7addbedb9870204783aee6d | train_002.jsonl | 1363188600 | The Bitlandians are quite weird people. They do everything differently. They have a different alphabet so they have a different definition for a string.A Bitlandish string is a string made only of characters "0" and "1".BitHaval (the mayor of Bitland) loves to play with Bitlandish strings. He takes some Bitlandish stri... | 256 megabytes | import java.util.*;
public class mohammad{
public static void main(String args[]){
Scanner U = new Scanner(System.in);
String a; a=U.next();
long p =a.length();
String b; b=U.next();
long q =b.length();
boolean a1=false,b1=false;
if(p!=q)
System.ou... | Java | ["11\n10", "1\n01", "000\n101"] | 2 seconds | ["YES", "NO", "NO"] | null | Java 11 | standard input | [
"constructive algorithms",
"implementation",
"math"
] | 113ae625e67c8ea5ab07be44c3b58a8f | The first line contains Bitlandish string a, the second line contains Bitlandish string b. The strings can have different lengths. It is guaranteed that the given strings only consist of characters "0" and "1". The strings are not empty, their length doesn't exceed 106. | 1,500 | Print "YES" if a can be transformed into b, otherwise print "NO". Please do not print the quotes. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.