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
f83bc251438d3b7865297679ac0afc3d
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.util.*; public class E{ static long mod = 998244353; static long mi(long a) {return pow(a,mod-2);} static long pow(long b, long e) { if (e==0)return 1; long r = pow(b,e/2); r = r*r%mod; if (e % 2 == 1) return r * b % mod; return r; } public static v...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 11
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
9b00f6d1965a7bbde99ecfa692039bdb
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.util.*; public class AssimilationIV implements Runnable { void solve() { mod = 998244353; int n = ri(), m = ri(); int[][] arr = new int[m][n]; for (int i = 0; i < n; i++) { for (int j = 0; j < m; j++) { arr[j][i...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 11
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
afe7063be6a4f0b8eadc2ea01f679bd4
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.math.BigInteger; import java.util.*; import java.io.*; public class Div716 { static int n, m, a[][]; static int mod = 998244353; static long[] fact; static long[] inv; static void preprocess() { fact = new long[n + 1]; inv = new long[n + 1]; fact[...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 11
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
9866993df8b72f2dd54f015e5c64c93c
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
//package ecr109; import java.io.*; import java.util.ArrayDeque; import java.util.Arrays; import java.util.InputMismatchException; import java.util.Queue; public class E { InputStream is; FastWriter out; String INPUT = ""; void solve() { int n = ni(), m = ni(); int[][] a = nmi(n, m); final...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 11
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
ed6db8e26635432c6df85cfbb473605d
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; //import java.math.*; public class Task{ // ..............code begins here.............. static long mod=(long)1e9+7,mod1=998244353l,inf=(long)1e17; /* https://www.hackerrank.com/contests/goc-cdc-series-7/challenges/different-chocolates/submissions/code/133589...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
eaaf7175ca9aa3ff6b8ba418d753d36c
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; //import java.math.*; public class Task{ // ..............code begins here.............. static long mod=(long)1e9+7,mod1=998244353l,inf=(long)1e17; /* two ways to find Expectation 1. Ususal way - sum(probailty*no_of_conquered_points) 2. See expected value of ...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
5794d6e0428d1a28f93e904a5b1e731d
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; //import java.math.*; public class Task{ // ..............code begins here.............. static long mod=(long)1e9+7,mod1=998244353l,inf=(long)1e17; static void solve() throws IOException { int[] x=int_arr(); int n=x[0],m=x[1]; ...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
96f5f9900a0e7e26d32105fddbe1d9f4
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; //import java.math.*; public class Task{ // ..............code begins here.............. static long mod=(long)1e9+7,mod1=998244353l,inf=(long)1e17; static void solve() throws IOException { int[] x=int_arr(); int n=x[0],m=x[1]; ...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
28d6d2fb7241e4944b41f0f3d7611ca6
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; //import java.math.*; public class Task{ // ..............code begins here.............. static long mod=(long)1e9+7,mod1=998244353l,inf=(long)1e17; static void solve() throws IOException { int[] x=int_arr(); int n=x[0],m=x[1]; ...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
729869544a65e61dfccc6e0f752d6c05
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class tr1 { static PrintWriter out; static StringBuilder sb; static long mod = (long) 998244353; static int[][] memo; static int n, m; static ArrayList<Integer>[] ad; static HashMap<Integer, Integer>[] going; static long inf ...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
be7b60cab61c3bd91270edd910a7a174
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; public class tr1 { static PrintWriter out; static StringBuilder sb; static long mod = (long) 998244353; static int[][] memo; static int n, m; static ArrayList<Integer>[] ad; static HashMap<Integer, Integer>[] going; static long inf ...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
98088c104a04204cf4527197401cdf58
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; public class E1525 { static final int mod = 998244353; public static long npk(int n, int k) { if (k < 0 || k > n) return 0; long ans = 1; for (int i = 0; i < k; i++) { ans = ans * (n - i) % mod; } return ans; } public static long modPow(long a...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
37ab131be246b886d546e5837f4c9077
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
//https://github.com/EgorKulikov/yaal/tree/master/lib/main/net/egork import java.util.*; import java.io.*; public class A{ static PrintWriter out; static InputReader in; public static void main(String args[]){ out = new PrintWriter(System.out); in = new InputReader(); new A(...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
78d783793e7356a2c17296f4bd0e0706
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.util.*; public final class Solution { static PrintWriter out = new PrintWriter(System.out); static FastReader in = new FastReader(); static Pair[] moves = new Pair[]{new Pair(-1, 0), new Pair(1, 0), new Pair(0, -1), new Pair(0, 1)}; // Monocarp's empire has 𝑛 c...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
070a39043402f6b8bd4bd833d65ac90d
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String args[]) {new Main().run();} FastReader in = new FastReader(); PrintWriter out = new PrintWriter(System.out); void run(){ work(); out.flush(); } long mod=998244353; long gcd...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
3d01b429ac7000d9aecc797db87e97f4
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.util.*; import java.math.*; import java.awt.Point; public class Main { //static final long MOD = 1000000007L; //static final long MOD2 = 1000000009L; static final long MOD = 998244353L; //static final long INF = 500000000000L; static final int INF = 100...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
dd86cba9e507e5ad06c75383f11ee756
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
/* bts songs to dance to: I need U Run ON Filter I'm fine */ import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.System.out; import java.util.*; import java.io.*; import java.math.*; public class x1525E { static final long...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
227248bf7312ca8b872e52c572cbe2f6
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.util.*; import java.io.*; public class EdC { static long[] mods = {1000000007, 998244353, 1000000009}; static long mod = mods[1]; public static MyScanner sc; public static PrintWriter out; static long[] fact; public static void main(String[] havish) throws Exception{ // TODO Auto-gene...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
f7ba3eeb4994de9bf04054733f28f6fb
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Arrays; import java.util.StringTokenizer; import java.util.List; import java.util.*; public class realfast implements Runnable { private static final int INF = (int) 1e9; long in= 998244353; long fac[]= new long[1000001]; lon...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
66e44a44d621024c4f3c361e55f7ebe5
train_110.jsonl
1621152000
Monocarp is playing a game "Assimilation IV". In this game he manages a great empire: builds cities and conquers new lands.Monocarp's empire has $$$n$$$ cities. In order to conquer new lands he plans to build one Monument in each city. The game is turn-based and, since Monocarp is still amateur, he builds exactly one M...
256 megabytes
import java.io.*; import java.util.*; public class Main{ static int mod=998244353; static long fastpow(long n,long ti) { if (ti == 0) return 1l; if(ti%2==0) { long y=fastpow(n, ti/2); long k=y*y; k%=mod; return k; } else { long y=fastpow(n, ti/2); long k=((n*y)%m...
Java
["3 5\n1 4 4 3 4\n1 4 1 4 2\n1 4 4 4 3"]
2 seconds
["166374062"]
NoteLet's look at all possible orders of cities Monuments will be build in: $$$[1, 2, 3]$$$: the first city controls all points at distance at most $$$3$$$, in other words, points $$$1$$$ and $$$4$$$; the second city controls all points at distance at most $$$2$$$, or points $$$1$$$, $$$3$$$ and $$$5$$$; the thir...
Java 8
standard input
[ "combinatorics", "dp", "math", "probabilities", "two pointers" ]
81f709b914ca1821b254f07b2464fbf2
The first line contains two integers $$$n$$$ and $$$m$$$ ($$$1 \le n \le 20$$$; $$$1 \le m \le 5 \cdot 10^4$$$) — the number of cities and the number of points. Next $$$n$$$ lines contains $$$m$$$ integers each: the $$$j$$$-th integer of the $$$i$$$-th line $$$d_{i, j}$$$ ($$$1 \le d_{i, j} \le n + 1$$$) is the distanc...
2,100
It can be shown that the expected number of points Monocarp conquers at the end of the $$$n$$$-th turn can be represented as an irreducible fraction $$$\frac{x}{y}$$$. Print this fraction modulo $$$998\,244\,353$$$, i. e. value $$$x \cdot y^{-1} \bmod 998244353$$$ where $$$y^{-1}$$$ is such number that $$$y \cdot y^{-1...
standard output
PASSED
3bb299e1ca9c18ba10ca4454bdd7fe9a
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class cf820b { public static void main (String[] args){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t--!=0){ // int a=sc.nextInt(); // String str=sc.next(); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
dfb7aeec875b2ba9b34c023ce23111df
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Collections; // import java.util.Scanner; import java.util.StringTokenizer; public class cf820b1 { static FastReader sc=null; // static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); /...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
b8d81b4b7f82a277c7df553760a38c71
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.util.ArrayList; import java.util.Collections; // import java.util.Scanner; import java.util.StringTokenizer; public class cf820b1 { static FastReader sc=null; // static StreamTokenizer in = new StreamTokenizer(new BufferedReader(new InputStreamReader(System.in))); /...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
3c0f25695fac4b1ad696c7ee27c33298
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public final class program{ public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); while(t != 0) { int n = s.nextInt(); String st = s.next(); char arr[] = new char[261];...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
ff2d071b992a4b6728a630a3de3dd695
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
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(); sc.nextLine(); String s=sc.nextLine(); int i=n-1; Stri...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
175ffb786572f2ea0f4f5167f2f38740
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Arrays; import java.util.LinkedHashSet; import java.util.LinkedList; import java.util.List; import java.util.Scanner; import java.util.Set; import java.util.TreeSet; public class Problem { public static void main(String[] args) { Scanner scanner=new Scanner(System.in); int t...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
9d1f7240c0fc9e999590d8d3533dd499
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; import java.util.*; public class Decode { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while (T-- > 0) { int n = sc.nextInt(); String s = sc.next(); String ss ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
c5f2212950b21ccc9a963cbb4bd53852
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class Elevators{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int t= sc.nextInt(); while(t!=0){ int n=sc.nextInt(); String s=sc.next(); String ans=""; n=n-1; while(n>=0){...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
1e7b419b9f7d26d1f66a0af47de87191
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.lang.StringBuilder; import java.io.*; public class Poly { public static void main(String[] args) throws Exception { BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); int tests = Integer.parseInt(reader.readLine()); for (int i = 0; i < tests; i++) { ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
8a22328e1ab6c08517d01199e3e76aa2
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.BufferedReader; import java.io.InputStreamReader; import java.io.IOException; import java.util.StringTokenizer; import java.util.ArrayList; public class Main { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(Sys...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
4d1985c4fa106c96d4699a9bae38b0fb
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Decode_String { static Scanner sc = new Scanner(System.in); public static String solve(String string, int length) { // my first solution // String result = ""; // String buffer = ""; // for (int i = 0; i < length; i++) { // ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
d45dd33a62784e2180bc4e48476458d1
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; public class Question2{ public static void main(String[] args) throws Exception{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); while(t-- > 0){ int n = Integer.parseInt(br.readLine()); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
df972553bc2bde04ae9cd3c4daa4d962
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class test { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int m = sc.nextInt(); ArrayList<String> ans = new ArrayList<>(m); while (m-- != 0) { int length = sc.nextInt...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
608743b8e9aaca860d89cc5a863235f5
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Q12 { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); char[] ch1 = "abcdefghijklmnopqrstuvwxyz".toCharArray(); while(n!=0){ String w=""; int a=sc.nextInt(); Str...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
e40e13e13f955a513d335b3da22972b0
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.io.*; public class CodeForces { public static StringBuilder sb=new StringBuilder(); public static void main(String[] args) { //StringBuilder sb=new StringBuilder(); Scanner scn=new Scanner(System.in); int t=scn.nextInt(); while(t-->0) ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
edc68942b9d8d9941a79527db54d059a
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class DecodeString { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int q = sc.nextInt(); for (int j = 0; j < q; j++) { int n = sc.nextInt(); String t = sc.next(); char[] code = t.toCharAr...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
aa316d5fcc56877572a33cb83670b193
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
// Online Java Compiler // Use this editor to write, compile and run your Java code online import java.util.HashMap; import java.util.Scanner; import java.lang.StringBuilder; public class Main { public static HashMap<String, String> charMap = new HashMap<>(); static { for(int i = 97;...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
ff00818769f7d07136d61a256d582abe
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
// Online Java Compiler // Use this editor to write, compile and run your Java code online import java.util.HashMap; import java.util.Scanner; import java.lang.StringBuilder; public class Main { public static HashMap<String, String> charMap = new HashMap<>(); static { for(int i = 97;...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
5da811f1b77d3ca50f8b3283171c9c66
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
//package com.codeforces.div3.round820; import java.util.Scanner; /** * https://codeforces.com/contest/1729/problem/B */ public class B { private static final String[] ALPHABET = new String[]{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
71495e1d531ee6199963af2e8e7ddb1f
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.lang.*; public class Trial { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); String[] arr = new String[n]; for(int i = 0; i < n; i++) { //conve...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
545428268ccba2e06fe95d42c169f8ec
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Main { public static void main (String[] args){ Scanner in = new Scanner(System.in); int q = in.nextInt(); in.nextLine(); for (int j = 0; j < q; j++) { String n = in.nextLine(); String t = in.nextLine(); char[...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
f97cf34a593e7528466006008adcd456
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.io.*; public class MainTwo { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st =...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
a69f414ac5aae0fd5222113c24c01612
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.ArrayList; import java.util.List; import java.util.Scanner; /** * @author Nikolay Chistykov */ public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int n = sc.nextInt(); while (n-- > 0) { ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
48976f97c303b5879392ee6e6b20949f
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
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 Main { public static void main (String[] args) throws java.lang.Exception { ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
1eba08a4e7e1e067a9e338e6c344d871
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class index { public static String reverse(String str) { return new StringBuilder(str).reverse().toString(); } public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); while( t != 0 ){ ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
6b0e9151ebe76d8723ed3039379b4bd7
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args)throws Exception { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int t=Integer.parseInt(br.readLine()); for(int i=0;i<t;i++) { int...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
17d406d0f65766b5981ede96aa409fed
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.util.*; import static java.lang.Math.*; import static java.lang.System.*; public class DecodeString implements Runnable { private final void process() throws IOException { // InputReader input = new InputReader(new FileReader(System.getenv("INPUT"))); // PrintW...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
26e74fb91c3866ef521c4d4ee6013e9a
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Main1 { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int t = scanner.nextInt(); while (t > 0) { t--; int n = scanner.nextInt(); String s = scanner.next(); System.ou...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
e03932bca0cf0a1dae6ad9a2a2a6dd4f
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public final class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); for(int t = 1; t<=T; t++){ int n = sc.nextInt(); //no. of digits in string-code String code = sc.next(); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
aceddd1d295247c2e7c29371ee8a0cb1
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
/****************************************************************************** Online Java Compiler. Code, Compile, Run and Debug java program online. Write your code in this editor and press "Run" button to execute it. ***********************************************...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
1b5093024366bf490464e44d2579386f
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class DecodeString { public static void main(String[] args) { int q, aux, d, u, con; String cad, res; Scanner scanner = new Scanner(System.in); q = Integer.parseInt(scanner.nextLine()); for(int i=0;i<q;i++) { aux...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
a19c511dc0b8f38aa96ba45d735bf150
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.util.*; public class Main { static FastReader s = new FastReader(); public static void solve(){ int n = s.nextInt(); String str = s.next(); // int[] arr = new int[n]; StringBuilder b = new StringBuilder(); // Read Array ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
b4dc57119e62323fca45b6f0c66a60e1
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class problemB { public static void main(String[] args) { Scanner sh = new Scanner(System.in); int t = sh.nextInt(); while(t>0){ int n = sh.nextInt(); sh.nextLine(); String s = sh.nextLine(); StringBuilder sb = new Stri...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
1ef3d10599a9bfcc54c9acbd0fb8a91a
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class test { public static void main(String [] args){ Scanner sc=new Scanner(System.in); int x= sc.nextInt(); for(int i=0;i<x;i++){ int y= sc.nextInt(); String m= sc.next(); String code=""; for(int j=m.length()-1;j>=0;j--){ char a=' '; if(m.charAt...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
1a80045368be1747485e88547146f2c0
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class test { public static void main(String [] args){ Scanner sc=new Scanner(System.in); int x= sc.nextInt(); for(int i=0;i<x;i++){ int y= sc.nextInt(); String m= sc.next(); String code=""; for(int j=m.length()-1;j>=0;j--){ char a=' '; if(m.charAt...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
30aae54034815be040183fbd5373a2a0
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class decodeString { public static void p(Object o) { System.out.println(o); } public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testCases = sc.nextInt(); while (testCases --> 0) { int length = ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
af633a491d84e4f3183986805d29857f
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.ArrayList; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t>0) { ArrayList<Integer> arr = new ArrayList<Integer>(); int l = sc.nextInt(); String s = s...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
9e4c16bcb64969caec881f29d6398732
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class DecodeString { public static void main(String[] args) { Scanner input=new Scanner(System.in); int t=input.nextInt(); while(t!=0){ int n=input.nextInt(); //(((int)c1-48)*10)+((int)c2-48) String s=input.next(),x="...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
0672350d25f9688787754a8b34a90660
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); for (int i = 0; i < t; i++) { int n = scan.nextInt(); scan.nextLine(); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
69177e617e42149cef42f8b557cbaad1
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.util.*; public class sleep { static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( new InputStreamReader(System.in)); } Strin...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
12794a9d911ae3bfb32ccc98bb4301ac
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class hello { public static void main(String[] args){ Scanner innn = new Scanner(System.in); int n = innn.nextInt(); int k = 0; int nn = 0; String ans = ""; String s = ""; for(int j = 0; j < n; j++){ ans...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
22453907e3d70e8acd1e90d5c21a177d
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args){ Scanner input = new Scanner(System.in); int n = input.nextInt(); String currentData; StringBuilder ans = new StringBuilder(""); String alp = "0abcdefghijklmnopqrstuvwxyz"; ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
13f4dc0c37d61ad4f1cdb39f9ff10e6a
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class Abai { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0){ int n = sc.nextInt(); sc.nextLine(); String s = sc.nextLine(); String answer...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
f26ca5c4c9bda26a6b986d93578db871
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.util.*; public class Solution { public static String sol(int a, String b) { String res = ""; for (int i = b.length() - 1; i >= 0; i--) { if (b.charAt(i) == '0') { int x = Integer.parseInt("" + b.charAt(i - 2) + b.charAt(i - 1))...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
da5da52a76c22465cf489899c87183f1
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int x = sc.nextInt(); while (x-- > 0) { StringBuilder s = new StringBuilder(); int n = sc.nextInt(); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
f172ae593926ba722b5a6472db741eb3
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.math.*; public class codeforces { public static void main(String[] args) { Scanner sc = new Scanner(System.in); long t = sc.nextInt(); while(t>0){ int n = sc.nextInt(); String s = sc.next(); String ans =""; ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
d38f39f4e4c0be3a569a9c07d2aa5a0c
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class pro2 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int q= sc.nextInt(); while(q>0) { int n = sc.nextInt(); String t = sc.next(); q--; System.out.println(solve(t, n)); } ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
19808ac8c97d7d45f9367e651747b6fc
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.math.*; import java.io.*; public class Main { static ArrayList<Integer> prime = new ArrayList<>(); static long mod = 1000000007; static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReade...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
ffdbff1c183acda3a54c27b8531815d2
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.io.*; public class decodeString { public static PrintWriter pw = new PrintWriter(System.out); static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(Sys...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
25751aadb78132f84f79424ec6eb79b9
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class B { public static void solve(Scanner sc) { int n = Integer.parseInt(sc.nextLine()); String s = sc.nextLine(); StringBuilder sb = new StringBuilder(); for(int i = 0;i < n; i++) { if(s.charAt(i) > '2') { sb.append((char)((s.charAt(i)-'0') +96)); } else if(s.charAt...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
60a88d5598dc33fb9f060a0870abc82c
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.lang.*; public class Solution { public static void main(String []args){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); Str...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
737b6ef6ebaa4193c8789a1fcd5a5342
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
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) throws java.lang.Exception { int t; Scanner sc=ne...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
824a2452270ef0e1459d1539867212c6
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class decode { public static void main (String[] args) throws java.lang.Exception { Scanner sc=new Scanner(System.in); int T=sc.nextInt(); for(int i=1;i<=T;i++){ int n=sc.nextInt(); String s=sc.next(); String code...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
fadf7957d73211fd33bc870e6728f66e
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.math.BigInteger; import java.util.*; /** * * @author eslam */ public class Solution { // Beginning of the solution static Kattio input = new Kattio(); static BufferedWriter log = new BufferedWriter(new OutputStreamWriter(System.out)); static ArrayList<Ar...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
b3a4346606d425527664f3afe998626e
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class codechef { public static void main (String[] args) { Scanner sc=new Scanner(System.in); int t1=sc.nextInt(); while(t1-->0){ int n=sc.nextInt(); String t=sc.next(); String ans=""; for(int i=n-1;i>=0;i--){ char ch=t.charAt(i); if(ch=='0'){ ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
450bdaf8a0f414c1015186981d3ee003
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.lang.reflect.Array; import java.util.Scanner; public class Codeforces { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); char[] a=new char[26]; for(int i=0;i<26;i++) a[i]= (char) ('a'+i); fo...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
0d3df9bfce6200e43490568e3ed74bc7
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.PrintWriter; import java.util.LinkedList; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { try (Scanner in = new Scanner(new BufferedInputStream(System.in)); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
9c9bd8c2d8d7cb92197893888d23bc8a
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.StringTokenizer; public class B { private static Scan sc = new Scan(); public static void main(String[] args) { int n = sc.nextInt(); for (int i = 0; i < n; i++) { solve(); } ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
301100ac81bf98485e95b274e816a2af
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class Template { public static void main(String args[]){ int t; Scanner sc = new Scanner(System.in); t = sc.nextInt(); for(int q = 0; q < t; q++) { int n = sc.nextInt(); String code = sc.next(); StringBuilder msg = new StringBuilder(); char[] arr = new char[26...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
6f1d7497e273ac9ab3047f87a3b3398e
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class DecodeString { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int q = Integer.parseInt(sc.nextLine()); int n, j; String s; String decoded; Dictionary<String, String> codes = new Hashtable<>(); String alph = "abcdefghijklmnopqrstuv...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
a2721b83768cf54d40486653f3d75eed
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class compare{ public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); String s = sc.next(); StringBuilder input1 = new StringBuilder()...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
02b394aea61ded1aebb7c379d0b7f334
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.HashMap; import java.util.Scanner; import java.lang.StringBuilder; public class Main { public static HashMap<String, String> charMap = new HashMap<>(); static { for(int i = 97; i <= 122; i++){ int index = i - 96; String character = ((char) i)...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
88b93accf2840e416be9aef338221daa
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
//package _Decode_String; import java.util.Scanner; import java.util.Stack; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int t = scan.nextInt(); //testcases while(t-->0) { int n = scan.nextInt(...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
cf0393f5314ea69c254e177eb507dcaf
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.HashMap; import java.util.Scanner; import java.lang.StringBuilder; public class Main { public static HashMap<String, String> charMap = new HashMap<>(); static { for(int i = 97; i <= 122; i++){ int index = i - 96; String character = ((char) i)...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
1eab2df5ec7c118ef792d9d460628df0
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Decode_String_1729B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0){ int l = sc.nextInt(); String st = sc.next(); String ans = ""; ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
89d9ab5fa8ec8309ff6635ce6db72300
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.io.*; import java.util.*; public class Main{ public static void main(String[] args) { MyScanner sc = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out)); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(),i; ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
bc7c135237352b2eee7795b17da944f6
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int count = scanner.nextInt(); while (count > 0) { int length = scanner.nextInt(); String str = scanner.next(); String[] string...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
373e44440c4f2fa02355d9254110691f
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class problem { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t --> 0) { int n = sc.nextInt(); String s = sc.next(); StringBuilder sb = new StringBuilder(); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
5ba46dcee2dba87315878158ccb373bf
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
//package com; import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { public static void main(String[] args) { // write your code here Scanner in = new Scanner(System.in); Map<Integer,Character> map = new HashMap(); for(int i=1;i<=26;i++...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
faac379a8d49276e928c542240eca066
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner jin=new Scanner(System.in); int t=jin.nextInt(); while(t-->0){ int n=jin.nextInt(); String str=jin.next(); String ans=""; StringBuilder res=new StringBuilder(ans); ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
16d270257d7139f1db977ac3a9e62a6a
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class Solve { static Scanner sc = new Scanner(System.in); private static void solve() { ArrayList<Character> alp = new ArrayList<>(); for (int i = 0; i < 26; i++) { int b = 49 + i + '0'; Character a = (char) b; alp.add(a); } int n = sc.nextInt(); String s = sc.next(...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
2c67baaaeaa213024e930dff6829b753
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class test { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t=sc.nextInt(); while(t>0) { StringBuilder snew=new StringBuilder(""); int n=sc.nextInt(); n -= 1; S...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
9e20560269a82afaf3c7623b8a37f7b2
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(), i = 1; while(i <= n) { int l = scan.nextInt(); String s = scan.next(); String ans = ""; char[] a = s.toCharArray(); for(int j = 0; j...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
7211e17c1eecfda25bda82cfea8809f7
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); String alf = " abcdefghijklmnopqrstuvwxyz"; // ввод n int n = scanner.nextInt(); // ввод наборов for (int i = 0...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
b8b34cf89c30a10dad002386c88afe84
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class Main{ static Scanner sc = new Scanner(System.in); static void solve() { int n = sc.nextInt(); String s = sc.next(); String str = ""; for(int i = n-1; i>=0; i--) { if(s.charAt(i)=='0') { ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
502dcb8df74771537aa36c04597541cc
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class decodeString { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); for (int i = 0; i < n; i++) { int len = s.nextInt(); String word = s.next(); StringBuilder ans = new...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
66960621300363dcc0337bdb40ec4384
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for (int i = 0; i < t; i++) { int length = in.nextInt(); String tt = in.next(); int[] d = ne...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
bdd6e6cd335851f730cfe1e4b2e003d2
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.util.Scanner; public class hello { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int k = 0; int nn = 0; String ans = ""; String s = ""; for(int j = 0; j < n; j++){ ans = ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
c2780905c541b59f7289d857d33c19ff
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
// Input : Pratik import java.io.*; import java.util.*; public class JavaDeveoper { public static void main(String[] args) { try { System.setIn(new FileInputStream("input.txt")); System.setOut (new PrintStream(new FileOutputStream("output.txt"))); } catch (Exception e) { System.err.println("E...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output
PASSED
0d929ec4fc846ac814a8c5bdcd75f8ff
train_110.jsonl
1662993300
Polycarp has a string $$$s$$$ consisting of lowercase Latin letters.He encodes it using the following algorithm.He goes through the letters of the string $$$s$$$ from left to right and for each letter Polycarp considers its number in the alphabet: if the letter number is single-digit number (less than $$$10$$$), then ...
256 megabytes
import java.lang.*; import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int b=0;b<t;b++) { int n= sc.nextInt(); String s = sc.next(); String str = ""; int k; char c; ...
Java
["9\n\n6\n\n315045\n\n4\n\n1100\n\n7\n\n1213121\n\n6\n\n120120\n\n18\n\n315045615018035190\n\n7\n\n1111110\n\n7\n\n1111100\n\n5\n\n11111\n\n4\n\n2606"]
1 second
["code\naj\nabacaba\nll\ncodeforces\naaaak\naaaaj\naaaaa\nzf"]
NoteThe first test case is explained above.In the second test case, the answer is aj. Indeed, the number of the letter a is equal to $$$1$$$, so 1 will be appended to the code. The number of the letter j is $$$10$$$, so 100 will be appended to the code. The resulting code is 1100.There are no zeros in the third test ca...
Java 17
standard input
[ "greedy", "strings" ]
43081557fe2fbac39dd9b72b137b8fb0
The first line of the input contains an integer $$$q$$$ ($$$1 \le q \le 10^4$$$) — the number of test cases in the input. The descriptions of the test cases follow. The first line of description of each test case contains one integer $$$n$$$ ($$$1 \le n \le 50$$$) — the length of the given code. The second line of the ...
800
For each test case output the required string $$$s$$$ — the string that gives string $$$t$$$ as the result of encoding. It is guaranteed that such a string always exists. It can be shown that such a string is always unique.
standard output