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
b4ec2e46c55ec7997e7e75ef11c3c4ad
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
import java.io.*; import java.util.*; import java.util.Stack; import java.util.regex.Pattern; public class ROUGH { public static class FastReader { BufferedReader br; StringTokenizer st; //it reads the data about the specified point and divide the data about it ,it is quite fast //than using direct p...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
d8afdc95846b38c66762fea9aa51346b
train_002.jsonl
1560090900
Authors guessed an array $$$a$$$ consisting of $$$n$$$ integers; each integer is not less than $$$2$$$ and not greater than $$$2 \cdot 10^5$$$. You don't know the array $$$a$$$, but you know the array $$$b$$$ which is formed from it with the following sequence of operations: Firstly, let the array $$$b$$$ be equal to ...
256 megabytes
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ //package here; /** * * @author sokumar */ import java.io.*; import java.util.*; import java.text.*; import java.math.*; import jav...
Java
["3\n3 5 2 3 2 4", "1\n2750131 199999", "1\n3 6"]
4 seconds
["3 4 2", "199999", "6"]
null
Java 8
standard input
[ "greedy", "graphs", "number theory", "sortings", "dfs and similar" ]
07484b6a6915c5cb5fdf1921355f2a6a
The first line of the input contains one integer $$$n$$$ ($$$1 \le n \le 2 \cdot 10^5$$$) — the number of elements in $$$a$$$. The second line of the input contains $$$2n$$$ integers $$$b_1, b_2, \dots, b_{2n}$$$ ($$$2 \le b_i \le 2750131$$$), where $$$b_i$$$ is the $$$i$$$-th element of $$$b$$$. $$$2750131$$$ is the $...
1,800
In the only line of the output print $$$n$$$ integers $$$a_1, a_2, \dots, a_n$$$ ($$$2 \le a_i \le 2 \cdot 10^5$$$) in any order — the array $$$a$$$ from which the array $$$b$$$ can be obtained using the sequence of moves given in the problem statement. If there are multiple answers, you can print any.
standard output
PASSED
647fdb50a2e6cebaec372b50c9b070dc
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class HelloWorld{ public static void main(String []args){ Scanner s=new Scanner(System.in); int n=s.nextInt(); int minprob=1; for(int i=0;i<n;i++) {int a=s.nextInt(); int b=s.nextInt(); for(int j=1;j<=a;j++) if(j*b > a) {m...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
1cdf7aa298038d816c40a7718106f0c8
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; /** * @Created by sbhowmik on 18/12/18 */ public class UniformString { public static void main(String []args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); while ( n > 0) { int k = scanner.nextInt(); int t = sca...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
99076223d1de3d51ba8aa4dbc8b96f6b
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class uniformString { public static void main(String[] args)throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); short t=Short.parseShort(br.readLine()); ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
597b874f143480b3bd818bc1972efb65
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.StringTokenizer; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; public class test { public static void main(Str...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
68bf0a3e74fe9aa964c3882d33c99e56
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); String a = "abcdefghijklmnopqrstuvwxyz"; while(t-->0){ int n=s.nextInt(); int k=s.nextInt(); int i=0; int count=0; for(i=0;i<k;i++)...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
aff53b7468c803f790f3f755c9f03b59
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String [] args){ Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); for(int z = 0; z < t; z++) { int n = scanner.nextInt(); int k = scanner.nextInt(); int rem = n%k; int div = n/k; char []chars = {'a','b'...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
fe4c2dcb39fe4cd7910a54fd87cae6bb
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
/* package codechef; // 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 Codechef { public static void main (String[] args) { // your code goes here Scanner sc=new Scanner(System.in); ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
6f8e0890abcbfc24e3874e7f26af9bab
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { FastScanner sc = new FastScanner(System.in); PrintWriter pw = new PrintWriter(System.out); char[] alps = "abcdefghijklmnopqrstuvwxyz".toCharArray(); StringBuilder sb ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
b90c5703d22f828b344fd933c7413252
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; public class Test11 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int cases = in.nextInt(); for (int i = 0; i < cases; i++) { int length = in.nextInt(); int alpha = in.nextInt(); int l = 0; ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
51bd686e750e632a5695f1a1e91e4fac
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class HelloWorld{ public static void main(String []args){ Scanner s=new Scanner(System.in); int n=s.nextInt(); int minprob=1; for(int i=0;i<n;i++) {int a=s.nextInt(); int b=s.nextInt(); String str=""; for(int z=1;z<=b;z++) f...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
7de8e7ae21b788591972847f0cf9a312
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class HelloWorld{ public static void main(String []args){ Scanner s=new Scanner(System.in); int n=s.nextInt(); int minprob=1; for(int i=0;i<n;i++) {int a=s.nextInt(); int b=s.nextInt(); String str=""; for(int z=1;z<=b;z++) ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
4b392beece0082a759f6f8a854ad01e8
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class Main { public static void main(String args[]) { Scanner sc =new Scanner(System.in); int i = sc.nextInt(); while(i-->0) { int d = sc.nextInt(); int tt = sc.nextInt(); int v = d/tt; for(int y=0;y<tt;y++) for(int ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
23cddb0402213e8251b2ff7b4323da77
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class Uniform_Str { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); int k=sc.nextInt();int ch=97; String s=""; int f=n/k; int d=n%k; for(int i=1;i<=k;i++) { for(...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
39ec93243e6bf01fe8daf139a8a51cd6
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int o =sc.nextInt(); while(o-->0) { int a=sc.nextInt(),b=sc.nextInt(); String s="abcdefghijklmnopqrstuvwxyz"; int x = a/b; int y = a%b; int m = 0; for(int i=0;i<b;i++) { for(int j=0;...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
332157558e3653b28a16981ef101ad09
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; public class Main{ public static void main(String[] args){ @SuppressWarnings("resource") Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); while(t-- > 0) { int n = scanner.nextInt(); int k = scanner.nextInt(); StringBuilder stringBuilder =...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
53dc8d31d4cbc8ca76dc208001b0e724
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.HashSet; import java.util.Iterator; import java.util.Scanner; public class g { public static void main(String[] args) { Scanner s=new Scanner(System.in); String line=s.nextLine(); int n=Integer.parseInt(line); String alph="abcdefghijklmnopqrstuvwxyz"; for (int i = 0; i < n; i++) { line=s.nextLin...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
b9a1545aad12e32717c7c42b5f3f76f1
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class string { public static void main(String[] args) { Scanner line = new Scanner(System.in); int t = line.nextInt(); int n=0 ,k=0 ,m=0, l=0, i , j, h; char c; for( i=0; i<t ;i++) { StringBuffer S = new StringBuffer(); n = line.nextInt(); k = line.nextInt(); m= n/k...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
1bbde1b7e09b92b23cbf84694c82b20a
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; public class Codeforces1088A { public static void main(String[] args) throws java.lang.Exception { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); for (int i = 0; i < n; i++) { int x = scan.nextInt(); int y = scan.nextInt(); int count = x / y; char letter = '...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
141aa665aa4094e6b6b7577e2939dbb2
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; public class uniform { public static void main(String args[]) { Scanner s= new Scanner(System.in); int t=s.nextInt(); int q; for(q=0; q<t; q++) { int n= s.nextInt(); int k= s.nextInt(); int j=0, x=0, i; ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
afb6e4954f21bd5542f71907aeb45064
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.io.Writer; import java.io.OutputStreamWriter; import java.util.InputMismatchException; import java.io.IOException; import java.io.Input...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
530309db538ce8a8e4e1d1b8d7f93334
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class Demo { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); int k=sc.nextInt(); ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
7a56d4dad5e266e68538f3b274948635
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class Demo { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++) { int n=sc.nextInt(); int k=sc.nextInt(); ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
169fed163efc3de5288f091a4d1f7988
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import java.io.IOException; import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.InputStream; public class Main { public static void main(String[] args) { ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
054d1b23eb3ef767a919d6b388a129dd
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.io.Reader; import java.io.StreamTokenizer; import java.io.Writer; public class MaxMinFreqInString { private static Reader reader = new InputStream...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
7cf7bcb763e3a669fb7d93d1c3038ad0
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { Reader in = new Reader(); int t = in.nextInt(); while (t-- > 0) { int n = in.nextInt(); int k = in.nextInt(); String s = ""; int idx = 0; ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
4e1e852796c372c894b1de679ee81c70
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.math.BigInteger; import java.text.DecimalFormat; import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer stk =new StringTokenizer(br.re...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
b37396f4cc0ee4103767a25abb587b1e
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.BufferedInputStream; import java.util.*; import java.lang.*; public class Main { public static void main(String[] args) { int t,n,k; Scanner sc = new Scanner(new BufferedInputStream(System.in)); t = Integer.parseInt(sc.next()); StringBuilder s = new StringBuilder("");...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
f17f68bc4341a55e30803ed259487c55
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main(String[] args) { int t,n,k; FastScanner in = new FastScanner(System.in); t = in.nextInt(); StringBuilder s = new StringBuilder(""); int idx = 0; while(t-->0) { ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
e09eb6561621abee0625699d4150303e
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; import java.lang.*; public class Main { public static void main(String[] args) { int t,n,k; Scanner sc = new Scanner(System.in); t = Integer.parseInt(sc.next()); while(t>0) { StringBuilder s = new StringBuilder(""); int idx = 0; ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
654d14b9c1fe74809297743fe8567c04
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; import java.lang.*; public class Main { public static void main(String[] args) { int t,n,k; Scanner sc = new Scanner(System.in); t = sc.nextInt(); while(t>0) { StringBuilder s = new StringBuilder(""); int idx = 0; n = sc.nextInt...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
b419d5be2dc257512365977ed14c6b43
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.io.BufferedInputStream; import java.util.*; import java.lang.*; public class Main { public static void main(String[] args) { int t,n,k; Scanner sc = new Scanner(new BufferedInputStream(System.in)); t = Integer.parseInt(sc.next()); while(t>0) { StringBuilder s ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
e0c038518a2b53dc45e01a84e9b085f2
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner in=new Scanner(System.in); int t,n,k; char a[]= {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'}; t=in.nextInt(); for(int i=0;i<t;i++) { n=in.nextInt...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
43823443dde0e332765a139058dc204b
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.ArrayList; import java.util.Collections; import java.util.HashSet; import java.util.List; import java.util.Scanner; import java.util.Set; import java.util.StringTokenizer; import java.util.Vector; import javafx.util.Pair; import java.*; public class test { static Scanner s= new Scanner(System.in); ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
8df6ce6f38bbb81c48e4ca0b264a30c8
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
//package Contest527; import java.io.PrintWriter; import java.util.Scanner; public class mainA { public static Scanner enter = new Scanner(System.in); public static PrintWriter out = new PrintWriter(System.out); public static void main(String[] args) { int t=enter.nextInt(); for (int i = 0...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
44f853c26ad51fd04c045a10a798fa9f
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String letters = "abcdefghijklmnopqrstuvwxyz"; int tCase = in.nextInt(); for (int i = 0; i < tCase; i++) { int n = in.nex...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
07695d00d3c8f91dbc2e451e36c9183a
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String letters = "abcdefghijklmnopqrstuvwxyz"; int tCase = in.nextInt(); for (int i = 0; i < tCase; i++) { int n = in.nex...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
e519c73f098a93e10554a78b690d855b
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; /* Name of the class has to be "Main" only if the class is public. */ public final class Codechef { public static void main(String[] args) throws java.lang.Exception { Scanner s = new Scanner(System.in); int T = s.nextInt(); while (T-- > 0) { int N = s....
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
909f0a7e9d14ad66de8026313e803b08
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); byte t = sc.nextByte(); short c = 0; byte n, k; for (byte i = 0; i < t; i++){ n = sc.nextByte(); k ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
25868f55b002b144b0be905e31264f37
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; import java.math.*; public class Main { public static void main(String []args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); int a = -1; int b = -1; Character [] ar = new Character[26]; int [] frequency = new int[26]; for(int i=0;i<26;i++){ ar[i]=(...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
f5de77026db7751ea2d18cf04f5054b1
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Ideone { public static void main (String[] args) throws java.lang.Exception { Scanner sc=new Scanner(System.in); int t...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
c792beb1832c2a7a6d5119be1a4c60cf
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner input = new Scanner(System.in); int T = input.nextInt(); for (int i = 0; i < T; i++) { int n = input.nextInt(); int k = input.nextInt(); uniformString(n, k); } } private static void uniformString(int n, ...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
4ff1bff4e9e3424f0ccbf3abf096c865
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t--!=0) { int n=sc.nextInt(); int m=sc.nextInt(); int min=n/m; int mini=n%m; int l=n-mini; int s=0; int count=0; /...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
bd4562e397c12ee514f4be8093ab8b1d
train_002.jsonl
1545143700
You are given two integers $$$n$$$ and $$$k$$$.Your task is to construct such a string $$$s$$$ of length $$$n$$$ that for each $$$i$$$ from $$$1$$$ to $$$k$$$ there is at least one $$$i$$$-th letter of the Latin alphabet in this string (the first letter is 'a', the second is 'b' and so on) and there are no other letter...
256 megabytes
import java.util.*; public class UniformString{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int ti=0;ti<t;ti++){ int n = sc.nextInt(); int k = sc.nextInt(); int f = n/k; for(int i=0;i<n;i++){ System.out.print((char)(i%k+97)); } Syst...
Java
["3\n7 3\n4 4\n6 2"]
1 second
["cbcacab\nabcd\nbaabab"]
NoteIn the first example query the maximum possible minimal frequency is $$$2$$$, it can be easily seen that the better answer doesn't exist. Other examples of correct answers: "cbcabba", "ccbbaaa" (any permutation of given answers is also correct).In the second example query any permutation of first four letters is ac...
Java 8
standard input
[ "implementation" ]
fa253aabcccd487d09142ea882abbc1b
The first line of the input contains one integer $$$t$$$ ($$$1 \le t \le 100$$$) — the number of queries. The next $$$t$$$ lines are contain queries, one per line. The $$$i$$$-th line contains two integers $$$n_i$$$ and $$$k_i$$$ ($$$1 \le n_i \le 100, 1 \le k_i \le min(n_i, 26)$$$) — the length of the string in the $$...
800
Print $$$t$$$ lines. In the $$$i$$$-th line print the answer to the $$$i$$$-th query: any string $$$s_i$$$ satisfying the conditions in the problem statement with constraints from the $$$i$$$-th query.
standard output
PASSED
28ec1197c6da03709f4d9f4d2f2c99b3
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.PriorityQueue; public class d1 extends PrintWriter { static BufferedReader s = new BufferedRe...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
7c6bf3740358ca356e9878301c18e308
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
//package a2oj; import java.util.*; import java.io.*; public class JzzhuAndCities { private static ArrayList<LinkedList<Pair>>graph = new ArrayList<LinkedList<Pair>>(); private static long[] dist; private static boolean[] trainAvail; private static TreeMap<Long,TreeSet<Integer>>queue=new TreeMap<Long,TreeSet<Integ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
c9d15ea5690babed47dd290f86b1391f
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.io.InputStreamReader; import java.util.TreeSet; import java.util.StringTokenizer; import java.io.BufferedReader; /** * Built using CHelper plug-in * Actual solution is at the top */ public cl...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
dbd7e0cb9d77eee65c28f0565f7ab1f1
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedWriter; import java.util.*; import java.io.InputStream; import java.io.OutputStreamWriter; import java.math.BigInteger; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.io.IOException; /** * Built using CHelper plug-in * Actual solution is at the top ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
9975c40939110535a6add32b76ca1bf2
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.util.*; import java.io.*; import static java.lang.Math.*; import java.math.BigInteger; public class Main { static MyScanner scan; static PrintWriter pw; static long MOD = 1_000_000_007; static long INF = 1_000_000_000_000_000_000L; static long inf = 2_000_000_000; public static void ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
611cb84846e8bb3e657b100a90f8bef9
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.PriorityQueue; public class p0449B { public static void main(String[] args) throws IOException{ BufferedReader br = new Buff...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
b6b06a5e80e4606f0ea48d49091e591f
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Codeforce_449_B { static int n; static int m; static int k; static class Edge { int u, v, index; long w; boolean train; public Edge(int u, int ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
540844b18f1106064006ed4cae5b4ee1
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.*; import java.util.*; public class CF449B { static final boolean _DEBUG = true; static class MyScanner { BufferedReader br; StringTokenizer st; public MyScanner(BufferedReader _br) { br = _br; } String next() { while (st == null || !st.hasMoreElements()) { try { st = new S...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
8902027eee2e0b0abaf178d688fb4a59
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
//package practice; import java.util.*; import java.io.*; public class Practice { static ArrayList<edge> list[]; static boolean[] vis; static class edge implements Comparable<edge>{ int v; long w; boolean t; edge(int v, long w,boolean t) { this.v=v...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
71ba7b2638bc7c8fe6a744f455e25042
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
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.Collection; import java.util.List; import java.util.Locale; import java.util.PriorityQueue; import java.util.StringTokenizer; public class Main { public...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
b7ff41cbff2df1a1672f5ab0586762b6
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
/** * Created by Aminul on 8/21/2018. */ import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import static java.lang.Math.min; public class CF449B_2 { public static void main(String[] args)throws Exception { FastReader in = new FastReader(System.in); ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
7ead579b82be0b495b986d0f27853c3c
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
/* / フフ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ム / )\⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ Y (⠀⠀| ( ͡° ͜ʖ ͡°)⠀⌒(⠀ ノ (⠀ ノ⌒ Y ⌒ヽ-く __/ | _⠀。ノ| ノ。 |/ (⠀ー '_人`ー ノ ⠀|\  ̄ _人'彡ノ ⠀ )\⠀⠀ 。⠀⠀ / ⠀⠀(\⠀ #⠀ / ⠀/⠀⠀⠀/ὣ====================D- /⠀⠀⠀/⠀ \ \⠀⠀\ ( (⠀)⠀⠀⠀⠀ ) ).⠀) (⠀⠀)⠀⠀⠀⠀⠀( | / |⠀ /⠀⠀⠀⠀⠀⠀ | / [_] ⠀⠀⠀⠀⠀[___] */ // Main Code at th...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
def56ae6193890dee622235aadd77632
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.util.*; import java.io.*; public class cf_449B //Jzzhu and Cities { public static class Edge implements Comparable<Edge> { public int loc, id; //type 0 is road, type>=1 is train public long weight; public Edge(int l, int i, long w) { loc = l; id = i; weight = w; } public int co...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
4e18047a9185250c3be818aeaa17461b
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.util.*; import java.io.*; public class cf_449B //Jzzhu and Cities { public static class Edge implements Comparable<Edge> { public int loc, id; //type 0 is road, type 1 is train public long weight; public Edge(int l, int i, long w) { loc = l; id = i; weight = w; } public int com...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
079f1e8a3761308988d54fcd8b1f23ee
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.*; import java.util.*; public class Main { static final long INF = (long) 1e18; // don't increase, avoid overflow static ArrayList<Edge>[] adjList; static int V, parent[]; static class Edge implements Comparable<Edge> { int node; long cost; int f; Edge(int a, long b,int x) { no...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
e2a186f74f395a7060cb3840c48d39d8
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.*; import java.util.*; public class Main { static final long INF = (long) 1e18; // don't increase, avoid overflow static ArrayList<Edge>[] adjList; static int V, parent[]; static class Edge implements Comparable<Edge> { int node; long cost; boolean f; Edge(int a, long b,boolean x)...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
4121e57c779d7ed25a145fd9000fb1e4
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.*; import java.util.*; public class CF0449B { /** * If the length of the railroad between city 1 and i is longer than the minimal dist between 1 and i, delete * If the length of the railroad between city 1 and i is equal to the minimal dist between 1 and i, delete iff path is not unique ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
bd1126c370818cb730b4a863af7907b2
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; public class Jzzhu { public static class Edge implements Comparable<Edge>{ public int loc; public long weight; public boolean train; ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
3040fa2490460ea181807aa582b81177
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.StringTokenizer; public class JzzhuandCities { static class edge implements Comparable<edge> {...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
01881a6d63926fc6dedb38f03b07415d
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { solve(); } final static int MAXN = 5 * 1000000 + 5; final static int MAXK = 505; static int N = 0; static int M = 0; static int K = 0; static int W = 0; static int H = 0; static int[][] A; st...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
31c8c99017ec28731c8406d011a39ee7
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Comparator; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedLi...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
f72a06f9bc535dd90fff304e81ae0fb1
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.StringTokenizer; /* * GRAPH IS GIVEN BELOW. YOU NEED TO PRINT THE SHORTEST PATH FROM NODE 1...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
1380e967b16c21ba53d872cfb9a72257
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.StringTokenizer; public class _449B_JzzhuAndCities { static FastReader in; static PrintWrite...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
231313ad55d12c0708d0cc27b21094f0
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import org.omg.PortableServer.POA; import java.awt.*; import java.io.*; import java.util.*; public class Abc { public static void main(String[] args) throws Exception { FastReader sc = new FastReader(); long inf=(long)1e18; int n=sc.nextInt(),m=sc.nextInt(),k=sc.nextInt(); ArrayLis...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
7bb4cef1aac6780ee93a2593231019c7
train_002.jsonl
1405774800
Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connecting the cities. One can go from city ui to vi (and vise versa) using the i-th road, the length of this road is xi. Finally, there are k train routes in the country. One ...
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String[] args) { InputStream inputStream = System.in; OutputStream outputStream = System.out; InputReader in = new InputReader(inputStream); OutputWriter out = new OutputWriter(outputStream); ...
Java
["5 5 3\n1 2 1\n2 3 2\n1 3 3\n3 4 4\n1 5 5\n3 5\n4 5\n5 5", "2 2 3\n1 2 2\n2 1 3\n2 1\n2 2\n2 3"]
2 seconds
["2", "2"]
null
Java 8
standard input
[ "graphs", "greedy", "shortest paths" ]
03d6b61be6ca0ac9dd8259458f41da59
The first line contains three integers n, m, k (2 ≤ n ≤ 105; 1 ≤ m ≤ 3·105; 1 ≤ k ≤ 105). Each of the next m lines contains three integers ui, vi, xi (1 ≤ ui, vi ≤ n; ui ≠ vi; 1 ≤ xi ≤ 109). Each of the next k lines contains two integers si and yi (2 ≤ si ≤ n; 1 ≤ yi ≤ 109). It is guaranteed that there is at least one ...
2,000
Output a single integer representing the maximum number of the train routes which can be closed.
standard output
PASSED
75d3bcb69b7f10710ca603f7bdcf3443
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; import java.util.Map.Entry; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; // New Year Snowmen // 2012/1/5 public class P140C{ Scanner sc=new Scanner(System.in); int n; int[] rs; void run(){ n=sc.nextInt(); rs=n...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
07bb1f9742d1ef9f4468e20035245074
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; import java.util.Map.Entry; import java.lang.*; import java.math.*; import java.io.*; import static java.lang.Math.*; import static java.util.Arrays.*; public class C{ Scanner sc=new Scanner(System.in); int INF=1<<28; double EPS=1e-9; int n; int[] rs; void run(){ ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
3742a05b9aa54cdf44148c06bf6b0f64
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StreamTokenizer; import java.util.Arrays; public class C implements Runnable { public void solve() throws IOException { int n = nextInt(); int[] a = new int[n]; for ( int i = 0; i < n; ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
b213a9b79c0945d182c11ff648012afb
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.*; import java.util.*; public class b { BufferedReader in; PrintWriter out; StringTokenizer st; boolean can_read() throws Exception { return in.ready() || st.hasMoreTokens(); } void init(boolean file, String name) throws Exception { st = new StringTokenizer(" ")...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
8fc5ae65e95fdad91295ba0582a7d9aa
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.Arrays; import java.util.PriorityQueue; import java.util.Scanner; public class Prob140C { public static void main( String[] Args ) { Scanner scan = new Scanner( System.in ); int snowballs = scan.nextInt(); int[] ar = new int[snowballs]; for ( int x = 0; x < sn...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
5019fa554e69eba4f36caec8b6455327
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.Map; import java.util.List; import java.io.InputStreamReader; import java.io.IOException; import java.util.Arrays; import java.util.PriorityQueue; import java.util.ArrayList; import java.util.HashMap; import java.util.Set; import java.io.BufferedReader; import java.io.OutputStream; import java.io.Print...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
15f940e7712df85f6ff13098a2472e29
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.*; import java.util.*; public class C { final String filename = new String("C").toLowerCase(); class Pair implements Comparable<Pair> { int x, y; public Pair(int x, int y) { this.x = x; this.y = y; } @Override public String toString() { return x + " " + y; } @Override pub...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
b4ad06c8a82e1c3f6f8593b7db481913
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Main implements Runnable { private BufferedReader in; private PrintWriter out; private StringTokenizer st; private Random rnd; final String filename = "codeforces"; class Pair implements Comparable<Pair> { int val, howMuch; Pair(in...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
995ff89a7d4690524182fbb6224c7f99
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.io.StreamTokenizer; import java.util.Arrays; public class CR100A { // static Scanner in; static StreamTokenizer st; static int n; static int[] c; static PrintWriter out; public static void mai...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
0dd47148425efab98cff9eb974f896f3
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.PriorityQueue; public class C { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader in = new BufferedReader(new I...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
55637cf3c4eed6bf8d197f475a6ece84
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; import java.util.PriorityQueue; public class C { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader in = new BufferedReader(new I...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
ff7b1ab73f9246bebb03a0ae29db80fc
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.*; import java.util.*; public class C { private static void solve() throws IOException { int n = nextInt(); int[] r = new int[n]; for (int i = 0; i < n; i++) { r[i] = nextInt(); } Arrays.sort(r); List<Ball> balls = new ArrayList<Ball>(); int last = -1; for (int i = 0; i < n; i++) { ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
988d2fda711868464d8fb09bcf19e98c
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.PriorityQueue; import java.util.StringTokenizer; /** * 111118315581 * * -3 3 2 3 2 3 2 3 -3 3 -3 3 -3 3 2 3 * * @author pttrung */ public class C { ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
df625e3a8de3c6b268eb6d95a04e732c
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import static java.lang.Math.*; import java.util.*; import java.io.*; public class C { class El implements Comparable<El> { int cnt; int what; public El(int a, int b) { cnt = a; what = b; } public int compareTo(El o) { if (o.cnt == cnt) return o.what-what; ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
dc4e1acc110858ca9cb41f863a24a3e5
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; public class c { public static void main(String[] args){ Scanner br = new Scanner(System.in); int n = br.nextInt(); int[] nums = new int[n]; for(int i = 0;i<n;i++){ nums[i] = br.nextInt(); } Arrays.sort(nums); TreeSet<num> ns = ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
4c34ef0667beb2b8bf112ea33b407559
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; import java.io.*; public class Main { static class Number implements Comparable<Number> { int num,count; public Number(int n,int c) { num=n; count=c; } public int compareTo(Number o) { return o.count-count; ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
d164199d87a163eb32ee4a56bdd82313
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; import java.math.*; public class main { static Comparator<snowball> comp=new Comparator<snowball>() { public int compare(snowball e1,snowball e2) { if(e1.occ<e2.occ) return 1; return -1; } }; public static void main(String args[]) { Scanner c = new Scanner(System.in); int n=c.next...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
ac19576bf3a7e2ebcc99111570c39757
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; import java.math.*; public class main { static Comparator<snowball> comp=new Comparator<snowball>() { public int compare(snowball e1,snowball e2) { if(e1.occ<e2.occ) return 1; return -1; } }; public static void main(String args[]) {...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
f33997d496e303d4710c9ed0163d9959
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; import java.math.*; public class main { static Comparator<snowball> comp=new Comparator<snowball>() { public int compare(snowball e1,snowball e2) { if(e1.occ<e2.occ) return 1; return -1; } }; public static void main(String args[]) ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
7f1390d8915ea832bce80e2d1db02243
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.IOException; import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Scanner; import java.util.Set; import java.util.TreeMap; import java.util.TreeSet; @SuppressWarnings("unchecked") public class C_New_Year_Snowmen { static class Snow implements Comparable{ ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
0f5b72b139fb2d257443b30da070da90
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.*; import java.util.*; public class c{ public static void main(String[] args){ boolean ans; Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] r = new int[n]; for(int i = 0; i < n; i++){ r[i] = sc.nextInt(); } Arrays.sort(r); new c(n,r); } public c(int n, int[] r){ ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
2d9883fbe54c18be7db4154c4f1cba4f
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; public class C140 { private static class Pair implements Comparable<Pair> { int num, ct; Pair(int num, int ct) { this.num = num; this.ct = ct; } public int compareTo(Pair p) { int k = Integer.signum(ct - p.ct); if (k != 0) return k; return Integer.signum(num - p.num); } // ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
c6e58c5b8c3364d28513c86eab72a9a4
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
//package round100; import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Arrays; import java.util.Comparator; import java.util.PriorityQueue; import java.util.Queue; public class C { InputStream is; PrintWriter out; String INPUT = ...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
86b9ab6875192c5650fe24bcc7d08fa3
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; public class newyearssnowman { public static void main(String[] args) { Scanner in = new Scanner(System.in); int N = in.nextInt(); int[] balls = new int[N]; for (int n = 0; n < N; ++n) balls[n] = in.nextInt(); Arrays.sort(balls); PriorityQueue<Ball> next = new PriorityQueue...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
d12b5ce578f96c56202af0890bbfdbb7
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Comparator; import java.util.Scanner; import java.util.TreeSet; public class C { static class Struct { int node, count; public Struct(int n, int c) { node = n; count = c; } } public stati...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
75968e878137c8c35c1292b14d54fe84
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.util.*; public class Snowmen { public static void main(String[] args){ Scanner reader = new Scanner(System.in); int n = reader.nextInt(); int[] r = new int[n]; for(int i = 0; i < n; i++) r[i] = reader.nextInt(); Arrays.sort(r); PriorityQueue<Pair> q = new PriorityQueue<Pair>(); for(i...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
a458f85de14013bea47b461d9468cfae
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.io.InputStreamReader; import java.io.IOException; import java.util.Arrays; import java.util.PriorityQueue; import java.util.ArrayList; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.Writer; import java.util.AbstractCollection; import java.util.StringTo...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
79f09859c8f9fa67a17e9f4154ed54dd
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
//package round100; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.PriorityQueue; import java.util.StringTokenizer; public...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
727b7e88e2a9d5596f0b539731b0fcab
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.awt.Point; import java.io.*; import java.math.BigInteger; import java.util.*; import java.util.Map.Entry; import static java.lang.Math.*; public class C implements Runnable{ final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE") != null; BufferedReader in; PrintWriter out;...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output
PASSED
951d0ba13af5653976e86d60d33681e0
train_002.jsonl
1325689200
As meticulous Gerald sets the table and caring Alexander sends the postcards, Sergey makes snowmen. Each showman should consist of three snowballs: a big one, a medium one and a small one. Sergey's twins help him: they've already made n snowballs with radii equal to r1, r2, ..., rn. To make a snowman, one needs any thr...
256 megabytes
import java.awt.Point; import java.io.*; import java.math.BigInteger; import java.util.*; import static java.lang.Math.*; public class C { final boolean ONLINE_JUDGE = System.getProperty("ONLINE_JUDGE")!=null; BufferedReader in; PrintWriter out; StringTokenizer tok = new St...
Java
["7\n1 2 3 4 5 6 7", "3\n2 2 3"]
2 seconds
["2\n3 2 1\n6 5 4", "0"]
null
Java 6
standard input
[ "data structures", "binary search", "greedy" ]
551e66a4b3da71682652d84313adb8ab
The first line contains integer n (1 ≤ n ≤ 105) — the number of snowballs. The next line contains n integers — the balls' radii r1, r2, ..., rn (1 ≤ ri ≤ 109). The balls' radii can coincide.
1,800
Print on the first line a single number k — the maximum number of the snowmen. Next k lines should contain the snowmen's descriptions. The description of each snowman should consist of three space-separated numbers — the big ball's radius, the medium ball's radius and the small ball's radius. It is allowed to print the...
standard output