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
f773f082b28c8a6964c8e03efe0516db
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class ACM { private static Map<String, Integer> table = new HashMap<>(); public static void main(String[] args) { computeTable(); Scanner in = new Scanner(System.in); int t = in.nextInt(); in.nextLine(); for (; t > 0; t...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
acab77a7c490476979663e4f85c32010
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
//package com.company; import java.util.*; import java.io.*; public class Dictionary { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine()); while(--t >= 0) { ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
aa54a509d913f84a5ed8a912c2f738c8
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.io.PrintWriter; import java.io.BufferedWriter; import java.util.HashMap; import java.util.InputMismatchException; import java.io.IOException; import java.util.Map; import java.io.Writer; import ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
57a1b5ebd919ec96eb755fa1fc996c87
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Solution { static List<List<Integer>> ans; public static void main(String[] args) { Scanner sc=new Scanner(System.in); // div 3; int t=sc.nextInt(); while (t>0){ t--; String s=sc.next(); int ff=s.c...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
bda46134ed786648f1f41ead07b71339
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.io.*; public class Dictionary { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); final int a = 97; int num = sc.nextInt(); sc.nextLine(); ArrayList<String> arr = new ArrayList<String>(); for (int j = 97; j < 123;...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
100e6ad59df6f6f143c6dd99593c5e5a
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner SC=new Scanner(System.in); int T=SC.nextInt(); for(int i=1;i<=T;i++) { int count=1; int flag=0; String S=SC.next(); char c1=S.charAt(0); char c2=S.charAt...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
de210dcee74aa3b0055b25347d1e9155
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public final class CF { public static void main(String[] args) { FastReader ob = new FastReader(); HashMap<String,Integer> hm = new HashMap<>(); int c=1; for(char ch1='a';ch1<='z';ch1++) { for(char ch2 = 'a'; ch2<='z'; ch2++...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
8ec8d636bba4c141925d292a7a198791
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
//import java.io.IOException; import java.io.*; import java.util.ArrayList; import java.util.Collections; import java.util.InputMismatchException; import java.util.List; public class Dictionary { static InputReader inputReader=new InputReader(System.in); static ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
009010de87ef8637e5dbb2d4ecf280f0
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.HashMap; import java.util.Scanner; public class DetectiveTask { public static void main(String[] args) { Scanner sc = new Scanner (System.in); int n = sc.nextInt(); HashMap<String, Integer> hm = new HashMap<>(); int x= 1; for (int i = 'a' ; i <= 'z' ; i++) { for (int j = 'a...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
d06bae7ddb6841c6d77300869667e100
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int k = sc.nextInt(); for(int i =0;i<k;i++) { String s = sc.next(...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
be268c6ab7953af1c4400e45860b26b0
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Dictionary { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); ArrayList<String> dict = new ArrayList<>(); for(int i=0; i<26; i++){ for (int j=0; j<26; j++){ if (i...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
d8155c1404752cfd88885810c41d48ae
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; import java.util.StringTokenizer; public class B1674 { public static void main(String[] args) throws NumberFormatException, IOException { r.init(); int t = r.readInt(); while(t--...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
40d27c4c440c0c9de47732598a0fd51d
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; /** * * @author Acer */ public class NewClass_B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T-- > 0){ String s = sc.next(); int x = (int)s.charAt(0)-97; ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
5721a5e7d9f678d5f61c67a7093c37a7
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.lang.*; public class solve { static Scanner sc; public static void main (String[] args) { sc = new Scanner(System.in); // testCases int testCases = sc.nextInt(); while (testCases > 0) { justDoIt(); testCases--; } } // ==== SOLVE ============== s...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
252ebc3a4a39681249b5bac9aa016a9a
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class B { public static void main(String[] args) { Scanner sc = new Scanner(System.in); Map<String , Integer> map= new HashMap<>(); int idx = 1 ; for(int i=0 ; i < 26 ; i++){ for(i...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
ed45ed996de6a49e5c751d88b918ebac
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public class Dictionary { public static PrintWriter out; public static void main(String[] args)throws IOException{ Scanner sc=new Scanner(); out=new PrintWriter(System.out); int t=sc.nextInt(); while(t-->0) { String str=sc.next();...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
3928f0a78249d517978d415b738caa32
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class B { private static FastReader fr; private static OutputStream out; private static int mod = (int)(1e9+7); private void solve() { int t = fr.nextInt(); while(t-- > 0) { char arr[] = fr.next()....
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
a805164952f3cd687644c76e46ab155b
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.InputStream; import java.io.OutputStream; import java.io.PrintStream; import java.util.*; public class P1674B { ArrayList<String> dictionary = new ArrayList<>(); public static void main(String[] args) throws Exception { new P1674B().run(); } void run() throws Exception { Sca...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
f097e0f079352ea26e787cee014c186e
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.*; public class Main { public static void main(String args[]) { FastScanner input = new FastScanner(); ArrayList<String> a=new ArrayList<>(); for (cha...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
8491dd3d521d0987a35b62bd5f7d817e
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class Solution{ public static void main(String []args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); char[] chr = new char[2]; int index; for (int i = 0; i < n; i++) { ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
41540cdf41c30fa233666da560a8d5cc
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class B { public static void main(String[] args) { Scanner obj = new Scanner(System.in); int n = obj.nextInt(); while(n-->0) { String s = obj.next(); int k1 = ((int)(s.charAt(0)-'a')+1); int k2 = ((int)(s.charAt(1)-'a')+1); int ans = (k1-1)*25; i...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
9a72c9800acb165582869d61ba89f9df
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class Dictionary { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); for(int i=0;i<t;i++){ char[] ch=sc.next().toCharArray(); int a=ch[0]-'a'; int b=ch[1]-'a'; ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
b06380478c07f66e3cc8e0d1dda4c6ac
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
// package Round786DIV3; import java.io.*; import java.util.StringTokenizer; public class B { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); int t = sc.nextInt(); while(t-->0...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
357c0784570d2f16ab7baad77aeb4240
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public class A { public static void main(String[] args) throws IOException { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int t = sc.nextInt(); while (t-- > 0) { String s = sc.next(); int[] val = new int[2]; val[...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
50c363c7be167a3b3e8b89c28245b27b
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class aa { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int c = 0 ; while(t-->0){ String s = sc.next(); int a = ((int)(s.charAt(0))-96); int b = (a-1)*25; if (s.charAt(0)>s.charAt(1) ){ c = ((int)(s.charA...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
8cd19b8602914a82c74a24bb4d5d09cd
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Dictionary { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int t = Integer.parseInt(br.readLine());...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
6e44af05cd8ea46e2d2db981319abced
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public class B { public static void main(String[] args) { FastReader in = new FastReader(); PrintWriter out = new PrintWriter(System.out); int T = in.nextInt(); for(int ttt = 1; ttt <= T; ttt++) { char[] s = in.next().toCh...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
722e41e0d0ac0d9ac2dcafa15938b72a
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class Dictonary { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t>0){ String s=sc.next(); if(s.charAt(1)-'a'<s.charAt(0)-'a'){ System.out.println(25*(s.c...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
d48163584dba95ceb5898bc48f6c96df
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Priorit...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
82ad65ebf83a79e8b8be5e1c3ff475f6
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; import java.util.concurrent.locks.Condition; import java.util.concurrent.locks.ReentrantLock; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); for(int i=0; i<t; i++) { String str = s.next(); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
028dec43cc287b77646fcea3cc3b73df
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tc = sc.nextInt(); while(tc-->0) { char s[] = sc.next().toCharArray(); int ans = (s[0]-'a')*25 + s[1]-'a'; if(s[0]>s[1]) a...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
72e7ca60e2221b0074c4df07a5566701
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public class Main { public static int INF = 0x3f3f3f3f; public static int mod = 1000000007; public static int mod9 = 998244353; public static void main(String args[]){ try { PrintWriter o = new PrintWriter(System.out); bool...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
ec0a7d508141e85138d5c2a2bc9d02e4
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class B1674 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int T = in.nextInt(); for (int t=0; t<T; t++) { String S = in.next(); char ch0 = S.charAt(0); char ch1 = S.charAt(1); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
148787b8db51a26bc992dde5951d26b8
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Berland { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); sc.nextLine(); while(t-->0){ String s = sc.nextLine(); int n1 = getNum(s.charAt(0)); int n2 = ge...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
1403aa168f0bbe2c2ca8c152775bf018
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class MyClass{ public static void main(String[] args){ Scanner sc= new Scanner(System.in); int n = sc.nextInt(); while(n > 0){ String s = sc.next(); int a = s.charAt(0); int b = s.charAt(1); int numFirst = ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
f02f9bc290d92664741ea254e396ae1b
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.ByteArrayInputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.*; import static java.lang.System.currentTimeMillis; import static java.lang.System.getProperty; import static java.util.Arrays.binarySearch; import static java.util.Arrays...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
7c0feba7b354d68ea6ba9fea9334b004
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class HelloWorld { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); sc.nextLine(); while(t-->0) { String s=sc.nextLine(); if(s.charAt(0)>s.charAt(1)) ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
2be99b94aeee575560d3cb29262868cf
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class Solution{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int rows=Integer.parseInt(sc.nextLine()); while(rows>0){ String word=sc.nextLine(); int c=word.charAt(0)-'a',start=26*c,pos=word.charAt(1...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
e5a153207962099611ceda53e2e28df9
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 8
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
f53fc5fad83c9209f2beec0f39807c41
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.awt.image.ImageProducer; import java.util.*; public class Solution { static class P { char chara; int c; public P(char chara, int c) { this.chara = chara; this.c = c; } } static boolean prime[] = new boolean[1000001...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
eacd4e22f70e8dd61f1a85603570cff0
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; public class Dictionary { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Pr...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
cc0d3afd81f918420151e008e5045457
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; public class Dictionary { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Pr...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
84713ee391832a8da7f96bf4fa23ee1d
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; public class Dictionary { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Pr...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
d36559631d0eeda5431e4b3f36dec299
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class NewClass{ public static void main(String[]args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t>0) { String x=sc.next(); int alpha[]=new int[200]; int res=0; int ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
491665dbfcbae9eb94a1b7bfb1852af3
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.io.*; public class Dictionary { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int numTests = Integer.parseInt(br.readLine()); for (int i = 0; i < numTests; i++) { String wor...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
ddb5e90e84014b6c1f9254bf021b0071
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 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 Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Scanner sc = new Scanner(System.in); int ti = sc.n...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
ebd6c15e1337fea4c980de177e530d70
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 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 Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Scanner sc = new Scanner(System.in); int t = sc.ne...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
8f2997977dd08c6561ff6667bd5cd721
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class dictionary{ public static void main(String[] args) throws Exception{ Scanner scn=new Scanner(System.in); int t=scn.nextInt(); while(t-->0){ String s=scn.next(); char ch1=s.charAt(0),ch2=s.charAt(1); // System.out.println(ch2-'a'); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
3b3625b7f2fe7d65e981bc702990aa7b
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.FilterOutputStream; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); for(int t = in.nextInt();t>0;t--) { String s = in.next(); char c1 = s.charAt(0); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
8b8d74d11d6b0153a2709f76633e6115
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.lang.*; import java.util.*; import java.io.*; public class Main { void solve() { ArrayList<String> list = new ArrayList<>(); for(int i = 0; i < 26; i++) { for(int j = 0; j < 26; j++) { if(i == j) continue; cha...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
3f4d413ef594c4f3971f5761bd30cb42
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Main { public static void main(String[] args) { // write your code here Scanner scanner = new Scanner(System.in); ArrayList<Integer> arrayList = new ArrayList<>(); ArrayList<Integer> arrayList2 = new ArrayList<>(); int length = ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
9c6c4c120a27f5b1d671a9e4129b59eb
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class MyClass { public static void main(String args[]) { int t=0,x=0; String letter; int firstpos=0; int secondpos=0; int term=0; Scanner in=new Scanner(System.in); t=in.nextInt(); while(x<t){ letter=in.next(); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
9f891b1ca66d38a66e504a03ade39c3d
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.LinkedHashMap; import java.util.Map; import java.util.Scanner; public class Main2 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); Map<String, Integer> map = new LinkedHashMap<>(); int count = 1; ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
7878a96cd7e8fbbc1754f23b29acd210
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.lang.*; import java.io.*; public class Main { static long mod = (int)1e9+7; // static PrintWriter out = new PrintWriter(new BufferedOutputStream(System.out)); public static void main (String[] args) throws java.lang.Exception { FastReader sc =new FastReader(); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
4ba683af3370b9d4a6b98fff0304caa4
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Solution { static Scanner s = new Scanner(System.in); public static void solve() { String str = s.next(); int cnt = 1; for(char i='a';i<='z';++i) { for(char j='a';j<='z';++j) { if(i == j) continue; String res = i+""+j; ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
933fc53d510773ae2e06c84c5d971beb
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class B { public static void main(String[] args) { Scanner s = new Scanner(System.in); int t = s.nextInt(); while(t-- > 0) { String str = s.next(); Map<String,Integer> map = new HashMap<>(); int cnt = 1; for(char c='a';c<='z';++c) ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
84543b872ecbe2569e95ee0fe9c03eb5
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; import java.math.*; public class Solution{ public static void main(String[] args) { TaskA solver = new TaskA(); initFac(10001); int t = in.nextInt(); for (int i = 1; i <= t ; i++) { solver.solve(i, in, out); } ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
7954fd94a501dab11d0881ef73eddaf8
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 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){ String s=sc.next(); int a=s.charAt(0); a =a-96; int b=s.charAt(1); b=b-96;...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
42f58977ea8795ad2c7cf03c3ebed66c
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; import java.util.ArrayList; import java.util.Arrays; public class Dictionary { public static void main(String[] args) { Scanner in = new Scanner(System.in); ArrayList<String> alpha = new ArrayList<String>(Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h", "i", "j",...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
3b5d28b6533fd0fe85e04744b4551bc6
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; import java.util.ArrayList; import java.util.Arrays; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); ArrayList<String> alpha = new ArrayList<String>(Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
44d789db7723e8821f56edbd6f7ace0f
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int testCases = scan.nextInt(); for (int vedant = 0; vedant < testCases; vedant++) { String str = scan.next(); int value = (str...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
2e65b5f350b6e1c991df1fbac811f205
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class Solution { public static void main(String[] args) throws IOException { PrintWriter pw = new PrintWriter(System.out); Buf...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
9393dcec769036755de0ba775c3ecfd4
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public class Main { static ArrayList<String> l = new ArrayList<>(); public static void main(String[] args) { FastReader in = new FastReader(System.in); PrintWriter pw = new PrintWriter(System.out); int test = in.nextInt(); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
278c7c1246db81fe836c0423e4b09f6f
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public class Main { static Map<String,Integer> m; public static void main(String[] args) { FastReader in = new FastReader(System.in); PrintWriter pw = new PrintWriter(System.out); int test = in.nextInt(); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
0d496ea75e5a1edc3a6302ca3d45e709
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.StringTokenizer; public class cf1674B { public static void main(String[] args) { FastReader sc = new FastReader(); int t = sc.nextInt(); while(t-->0) {...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
a715aec12753e01f64e10b02da06dbf5
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashMap; import java.util.StringTokenizer; public class cf1674B { public static void main(String[] args) { FastReader sc = new FastReader(); String key; int counter = 1; Hash...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
a778c07f84b540aae116dfddfd4f9a36
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
//Utilities import java.io.*; import java.util.*; public class a { static int t; static ArrayList<String> arr = new ArrayList<String>(); public static void main(String[] args) throws IOException { for (int i = 'a'; i <= 'z'; i++) { for (int j = 'a'; j <= 'z'; j++) { if (i == j) { continu...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
c2b42754c993ff5c022b70ef0b7e56b8
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Disctionary { private static int A; public static void main(String[] args) { Scanner oj= new Scanner(System.in); A= oj.nextInt(); for(int i=0; i<A; i++) { String str= oj.next(); Solve(str); } } public ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
10a9b3cb2d16c577938b163df7e17f7a
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.io.*; public class Main{ static StringTokenizer st; static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); public static void main (String args[]){ ArrayList<Integer> solutions = new ArrayList<Integer>(); String[] code...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
c8532d20ba84157133c3b68c9a52b184
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Main { public static void main(String[] args) { //System.out.println("Hello World"); Scanner scn=new Scanner(System.in); int t=scn.nextInt(); scn.nextLine(); while(t-->0){ String s=scn.nextLine(); char ch1=s.charAt(0); char ch2=s.charAt(1); int a1=...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
0cbd170c36dca902ff748c3f7248c901
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 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){ String s = sc.next(); HashMap <Character,Integer> hm = new HashMap<>(); char c; int i=1; for(c ='a';c<='z';c++){ hm.put(c,i); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
768f8738b595d38fa24868a67511fccc
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class B_dictionary { static int berland_index(String str) { int[] arr = new int[26]; arr[0] = 0; arr[1] = 25; for (int i = 2; i < arr.length; i++) { arr[i] = arr[i - 1] + 25; } int part_1 = arr[str.charAt(0) - 'a...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
6fd88b28749f114745ab4271e96a75b2
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.text.SimpleDateFormat; import java.time.LocalTime; import java.util.*; public class CodeForces { static int MOD = 100007; public static void main(String[] args) throws java.lang.Exception { //PlayOff(); /*Interview i = new Interview(); int a =...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
0da3bd1f412e8ad676a3efa2ed7679b8
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.ArrayList; import java.util.Scanner; public class M11_13 { public static void main(String ... args){ Scanner x=new Scanner(System.in); int z=x.nextInt(); while(z>0){ String a=x.next(); System.out.println(m(a)); z--; } ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
47be1f1a6c8a00e3edebcc0f6aaedb83
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.io.*; public class Solution{ static BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); static BufferedWriter bw=new BufferedWriter(new OutputStreamWriter(System.out)); static StringTokenizer st; static final long mod=1000000007; publi...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
753c638a9b3629b25403fb68ff1724df
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class FastScanner { static BufferedReader br; static StringTokenizer st; static PrintWriter pw; static String nextToken() { ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
844e6fa96026d31d285ddcdd7d95a1c2
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; public class FastScanner { static BufferedReader br; static StringTokenizer st; static PrintWriter pw; static String nextToken() { ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
9a3fe91e974d338f03c6a0ecae81072f
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); int w; while(t > 0) { String s = sc.next(); if ((int) s.charAt(1) < (int) s.charAt(0)) w = (...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
3cc2199788e46a71120feca082557dcc
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.io.*; public class Solution{ static class FastReader{ BufferedReader br; StringTokenizer st; public FastReader(){ br=new BufferedReader(new InputStreamReader(System.in)); } String next(){ while(st==null || !st.hasMoreTo...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
ac87fd3f2f81a4bdd64e4d840ff76708
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.io.BufferedReader; import java.io.InputStreamReader; import java.lang.Math; import java.util.*; public class hi { public static void main(String[] args) throws java.lang.Exception{ InputStreamReader r=new InputStreamReader(System.in); BufferedReader br=new BufferedReader(r...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
a9d9db78b08faaba9ce4c5eaa9d3f08e
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.lang.*; public class B { public static void main(String[] args) { // TODO Auto-generated method stub Scanner sc = new Scanner(System.in); int t = sc.nextInt(); sc.nextLine(); for(int i = 0; i < t; i++) { String l = sc.nextLine(); int pos = (25 * (l.charAt(0) ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
a5f76aff659b10b0be78f7a8e508c5e1
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import javax.print.attribute.HashDocAttributeSet; import java.util.HashMap; import java.util.Scanner; public class Abc { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t!=0){ String str= sc.next(); int...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
132e66b4844b820e48b7db347f602c91
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; public class BDictionary { public static void main(String[] args) throws Exception { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br=new BufferedReader(isr); int t = Integer.parseInt(br.readLine()); for(int i =0;i<t;i++){ String word =...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
2e12fb26dfd0a5740037fd004a6a2e47
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class Sol1{ public static void main(String[] args) { Scanner scn = new Scanner(System.in); int ts = Integer.parseInt(scn.nextLine()); for(int t =0;t<ts;t++){ String str = scn.nextLine(); int x=(str.charAt(0)-97); int y=st...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
872b854767df357c6eae3ff3d640a90b
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 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) { String s = sc.next(); int a = s.charAt(0), b = s.charAt(1), c; if(b < a) ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
4eb4b5df051cce461b25531042e5c4a1
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.LinkedList; import java.util.Queue; import java.util.Stack; import java.util.StringTokenizer; public class Binary_Tree_Creation { static FastReader scn = new FastReader(); static class ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
bf77f064f7787a31867a693e0feccc31
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; public class store { public static void main(String args[]){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); String str[] = new String[t+1]; for(int i=0; i<=t; i++){ str[i] = sc.nextLine(); } int n=0; int arr[] = new...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
63390957af1c1344f80e5856b82ca6b2
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.InputMismatchException; public class B { public static int getCost(char c) { return c - 'a' + 1; } public static void main(String[] args) throws IOException { ReadInput in = new ReadInput(System.in); PrintWriter writer = new PrintWriter(...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
e207e5a2339be41170d329f8b7a8e9e6
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
/* AUTHOR-> HARSHIT AGGARWAL CODEFORCES HANDLE-> @harshit_agg FROM-> MAHARAJA AGRASEN INSTITUE OF TECHNOLOGY >> YOU CAN DO THIS << */ import java.util.*; import java.io.*; public class dictionary { public static void main(String[] args) throws Exception { int t = scn.nextInt(); while (t...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
23a8e6ffc148e256de9d013e1725ee7d
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.util.StringTokenizer; import java.io.InputStreamReader; public class div3 { public static class fastreader { BufferedReader br; StringTokenizer st; public fastreader() { br=new BufferedRea...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
cd546d4d6b4d01a2171a7fb8afc75e88
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.Scanner; public class Dictionary { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { String s = sc.next(); int ans = 1; pls: for (int i = 0; i ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
1c47da3ff5411fc471d7c5d27e0bb017
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; public class A { static long TIME_START, TIME_END; public static class Task { public void solve(Scanner sc, PrintWriter pw) throws IOException { String s = sc.next(); int rank = (s.charAt(0) - 'a') * 25 + (s.charAt(1) - 96); if (s.charAt(0) < s.charAt(1...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
37e856fa7c57ac85d1b265dfd0b8e48f
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Main { public static void process()throws IOException { String s=nn(); int first=s.charAt(0)-'a'; int second=s.charAt(1)-'a'; if(first==0) pn(second); else { int start=first...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
9e6e75d3570c70d93c5c0faf1d1c2f56
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; import java.util.*; import java.lang.*; public class Codechef { static class Reader { final private int BUFFER_SIZE = 1 << 16; private DataInputStream din; private byte[] buffer; private int bufferPointer, bytesRead; public Reader() { di...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
2058edd4b4efb59e5ed8aaeae22ad8b9
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; import java.lang.*; import java.io.*; import java.io.*; public class Main { static FastReader reader = new FastReader(); public static void main(String[] args) { int t = ri(); outerloop: while(t-->0) { String s = rs(); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
fe4717d7e08bcc770f737cbc0c66454d
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.math.RoundingMode; import java.text.DecimalFormat; import java.util.*; public class WorldRecord { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-->0) { String s =sc.next(); ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
f1c5a924694ba017fffee24c4868a22e
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.io.*; public class Alph { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader br = new BufferedReader (new InputStreamReader (System.in)); int numberSets = Integer.parseInt(br.readLine()); for (int nos = 0; nos < numberSets; nos++) { ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
54f142aeb90805026bab3258e21a7f44
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
/*LoudSilence*/ import java.io.*; import java.util.*; import static java.lang.Math.*; public class Solution { /*----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------*/ static FastScanne...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
3f5a06eeae7b2aacce8e14c64cfdf339
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
import java.util.*; /* * To execute Java, please define "static void main" on a class * named Solution. * * If you need more classes, simply define them inline. */ public class Solution { static Scanner sc = new Scanner(System.in) ; public static void solve() { String letters = sc.nextL...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output
PASSED
4cb871816c4c06d0a78bca251bc9c44d
train_107.jsonl
1651502100
The Berland language consists of words having exactly two letters. Moreover, the first letter of a word is different from the second letter. Any combination of two different Berland letters (which, by the way, are the same as the lowercase letters of Latin alphabet) is a correct word in Berland language.The Berland dic...
512 megabytes
// https://codeforces.com/problemset/problem/1674/B // B. Dictionary import java.util.*; import java.io.*; import java.text.*; public class Dictionary { // Generate your map here. Map<String, Integer> generateMap() { Map<String, Integer> map = new HashMap<>(); int index = 0; ...
Java
["7\n\nab\n\nac\n\naz\n\nba\n\nbc\n\nzx\n\nzy"]
2 seconds
["1\n2\n25\n26\n27\n649\n650"]
null
Java 11
standard input
[ "combinatorics", "math" ]
2e3006d663a3c7ad3781aba1e37be3ca
The first line contains one integer $$$t$$$ ($$$1 \le t \le 650$$$) — the number of test cases. Each test case consists of one line containing $$$s$$$ — a string consisting of exactly two different lowercase Latin letters (i. e. a correct word of the Berland language).
800
For each test case, print one integer — the index of the word $$$s$$$ in the dictionary.
standard output