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
05a4f45330f890357cb4be29dd8ea852
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
/* * @Author: Overstars * @Date: 2022-9-08 9:22:59 * @LastEditTime: 2022-9-08 9:23:16 * @LastEditors: Overstars */ import java.io.*; import java.util.*; public class CF1722A { public static String sortString(String inputString) { char Array1[] = inputString.toCharArray(); // converting input string to char array Arrays.sort(Array1); return new String(Array1); // return sorted string } public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pr = new PrintWriter(new OutputStreamWriter(System.out)); int t = sc.nextInt(); while(t-- > 0) { int n = sc.nextInt(); String s = sc.next(); //s = s.toLowerCase(); s = sortString(s); if (s.compareTo("Timru") == 0) pr.println("YES"); else pr.println("NO"); } sc.close(); pr.flush(); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
2786b00290823fcfbee9bbc4305f183c
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.HashMap; import java.util.Map; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); int t = input.nextInt(); HashMap hash = new HashMap<>(); hash.put('T', -1); hash.put('i', -1); hash.put('m', -1); hash.put('u', -1); hash.put('r', -1); while (t > 0) { int n = input.nextInt(); String s = input.next(); if (n != 5) { System.out.println("No"); } else { int cnt = 0; for (int i = 0; i < s.length(); i++) { if (hash.containsKey(s.charAt(i))) { if ((int)hash.get(s.charAt(i)) == -1) { hash.replace(s.charAt(i), i); cnt++; } else { break; } } else { break; } } if (cnt == n) { System.out.println("Yes"); } else { System.out.println("No"); } } hash.replace('T', -1); hash.replace('i', -1); hash.replace('m', -1); hash.replace('u', -1); hash.replace('r', -1); t--; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
2972d4b9893684578e92a11756b2b8dd
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); // PrintWriter writer = new PrintWriter(System.out); String[] seq = {"T", "i", "m", "u", "r"}; int tries = scanner.nextInt(); for (int i = 0; i < tries; i++) { int num = scanner.nextInt(); String str = scanner.next(); if (num != 5) { System.out.println("No"); } else { if (str.contains(seq[0]) && str.contains(seq[1]) && str.contains(seq[2]) && str.contains(seq[3]) && str.contains(seq[4])) { System.out.println("Yes"); } else { System.out.println("No"); } } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
af3c31bb84304d528cc5b8e3590bfcf8
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class test { public static void main(String[] args) { Scanner inp = new Scanner(System.in); String b = "Timur"; int t = inp.nextInt(); for (int i = 0; i < t; i++) { int n = inp.nextInt(); inp.nextLine(); String a = inp.nextLine(); String ans = "YES"; if (a.length() != 5) { ans = "NO"; } else { for (int k = 0; k < 5; k++) { int j = 0; for (j = 0; j < 5; j++) { if (b.charAt(k) == a.charAt(j)) { break; } } if (j == 5) { ans = "NO"; break; } } } System.out.println(ans); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
f3303208881de1ffe8d04c7c90f13aa2
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.*; import java.util.*; import java.util.StringTokenizer; import java.math.*; public class SpellCheck { public static void main(String args[]) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(br.readLine()); int n = Integer.parseInt(st.nextToken()); // Loop through n test cases for(int i=0; i < n; i++) { st = new StringTokenizer(br.readLine()); int l = Integer.parseInt(st.nextToken()); st = new StringTokenizer(br.readLine()); String name = st.nextToken(); if(l != 5) { System.out.println("NO"); continue; } boolean tSeen = false; boolean iSeen = false; boolean mSeen = false; boolean uSeen = false; boolean rSeen = false; for(char c : name.toCharArray()) { if(c == 'T') { tSeen = true; } else if(c == 'i') { iSeen = true; } else if(c == 'm') { mSeen = true; } else if(c == 'u') { uSeen = true; } else if(c == 'r') { rSeen = true; } } if (!(tSeen && iSeen && mSeen && uSeen && rSeen)) { System.out.println("NO"); } else { System.out.println("YES"); } } } ///////////////////////////////////////////////////////////// // Template Functions ///////////////////////////////////////////////////////////// // Gets primes from 1..n public static ArrayList<Integer> getPrimes(int n) { ArrayList<Integer> primes = new ArrayList<Integer>(); primes.add(2); for(int i=3; i<n; i++) { boolean prime = true; for(int j : primes) { if(i%j == 0) { prime = false; break; } } if(prime) { primes.add(i); } } return primes; } public static int gcd(int n1, int n2) { if(n2 == 0) { return n1; } return gcd(n2, n1 % n2); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c80f86fb2c0db2bb9356fa45b8df54f8
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class spellCheck { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); String str=sc.next(); if(str.length()==5 && str.contains("T")&&str.contains("i")&&str.contains("m")&&str.contains("u")&&str.contains("r")) System.out.println("yes"); else System.out.println("No"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
1a161786f5fbec85f22d3f9c3b25d912
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.math.*; public class normal { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for (int tt = 0; tt < t; tt++) { int n=sc.nextInt(); String str =sc.next(); char arr1[]=str.toCharArray(); String s="Timur"; char arr2[]=s.toCharArray(); if(n!=s.length()){ System.out.println("no"); continue; } if(n==s.length()){ Arrays.sort(arr1); Arrays.sort(arr2); if(Arrays.equals(arr1,arr2)){ System.out.println("yes"); }else{ System.out.println("no"); } } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d2a2e2732a055fb75bf10ff0c63e20c1
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; import java.lang.*; public class main{ static Scanner sc = new Scanner(System.in); public static char[] ans = "Timru".toCharArray(); public static void Solve(){ int n = sc.nextInt(); String s = sc.next(); char a[] = s.toCharArray(); Arrays.sort(a); s = ""; for(char x : a) s += x; if(s.equals("Timru")){ System.out.println("YES"); } else { System.out.println("NO"); } } public static void main(String[] argv){ int t = sc.nextInt(); while(t -- > 0){ Solve(); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
72c278a25936142f37a299e8a7e6cfd4
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); for(int i=0;i<w;i++) { int a = t.nextInt(); String s = t.next(); String s1 ="Timur"; int l = s.length(); if(l==5 && s.contains("T") && s.contains("i") && s.contains("m") && s.contains("u") && s.contains("r")) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
bf2a22d39deee35af90731e3e8be1a00
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.IOException; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.io.PrintWriter; import java.util.StringTokenizer; public class Name { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out))); static StringTokenizer st; public static void main(String[] args) throws IOException{ long looptiming = readLong(); for(long i = 0; i < looptiming; i ++) { long leng = readLong(); String str = readLine(); char[] inspect = {'T','i','m','u','r'}; long counter = -1; boolean condition = false; if (leng == 5) { for (int h=0; h<5; h ++ ) { for (int k=0; k<5; k ++ ) { if (inspect[h] == str.charAt(k)) { counter = 0; break; }else { counter = 1; if (k == 4) { condition = true; break; } } } if(condition == true) { break; } } } if (counter == 0) { System.out.println("Yes"); }else { System.out.println("No"); } } } static String next () throws IOException { while (st == null || !st.hasMoreTokens()) st = new StringTokenizer(br.readLine().trim()); return st.nextToken(); } static long readLong () throws IOException { return Long.parseLong(next()); } static int readInt () throws IOException { return Integer.parseInt(next()); } static double readDouble () throws IOException { return Double.parseDouble(next()); } static char readCharacter () throws IOException { return next().charAt(0); } static String readLine () throws IOException { return br.readLine().trim(); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4ffa83feac47b41ee5bbf9c1bd0f1f0c
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.*; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class A { public static PrintWriter out; public static MyScanner scanner; private static void code() { int testcase = scanner.nextInt(); while (testcase-- > 0) { int n=scanner.nextInt(); String line=scanner.nextLine(); Set<Character> set=new HashSet<>(); boolean res=true; if(n==5) { for (char c: line.toCharArray()) { set.add(c); } for(var c: "Timur".toCharArray()) { if (!set.contains(c)) { res = false; break; } } }else res=false; out.println(res?"YES":"NO"); } } public static void main(String[] args) throws FileNotFoundException { // scanner = new MyScanner("./input.txt"); scanner = new MyScanner(); out = new PrintWriter(new BufferedOutputStream(System.out), true); // out=new java.io.PrintWriter(new java.io.BufferedOutputStream(new java.io.FileOutputStream("./output.text")),true); code(); out.close(); } static class MyScanner { private final BufferedReader bufferedReader; private StringTokenizer stringTokenizer; public MyScanner(String path) throws FileNotFoundException { bufferedReader = new BufferedReader(new InputStreamReader(new FileInputStream(path))); } public MyScanner() { bufferedReader = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (stringTokenizer == null || !stringTokenizer.hasMoreElements()) { try { stringTokenizer = new StringTokenizer(bufferedReader.readLine()); } catch (IOException e) { e.printStackTrace(); } } return stringTokenizer.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = bufferedReader.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
8ad889cc070f008699037e23c9006c96
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class MainCode { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); while(n-- > 0) { int k = sc.nextInt(); sc.nextLine(); char[] str = sc.next().toCharArray(); char[] arr = new char[] {'T', 'i', 'm', 'r', 'u'}; Arrays.sort(str); int flag = 0; for(int i=0; i < 5 && str.length == 5; i++) { if(str[i] == arr[i]) flag++; } if(flag == 5) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d2973c3a8a4d8544952d191950c7d2c9
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 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 = 0; i < t; i++) { int n = sc.nextInt(); String s =sc.next(); if (n == 5){ int countt = 0; int counti = 0; int countm = 0; int countu = 0; int countr = 0; int a = 0; for (int j = 0; j < 5; j++) { if (s.charAt(j) == 'T' && countt == 0){ countt++; a++; } else if (s.charAt(j) == 'i' && counti == 0){ counti++; a++; } else if (s.charAt(j) == 'm' && countm == 0){ countm++; a++; } else if (s.charAt(j) == 'u' && countu == 0){ countu++; a++; } else if (s.charAt(j) == 'r' && countr == 0){ countr++; a++; } else continue; } if (a == 5) System.out.println("YES"); else System.out.println("NO"); } else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
af1fedaa3c67a0da11bcb46a5ed15f26
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.HashSet; import java.util.Set; import java.util.Scanner; public class SpellCheck { public static void main(String[] args) { Scanner scr = new Scanner(System.in); int t = scr.nextInt(); while (t != 0) { int n = scr.nextInt(); String str = scr.next(); if (str.contains("T") && str.contains("i") && str.contains("m") && str.contains("u") && str.contains("r") && str.length() == 5) System.out.println("YES"); else System.out.println("NO"); t--; } scr.close(); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
b70fad1cb9b47cb038e4959c4a73eefe
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-- != 0){ int n = sc.nextInt(); String str = sc.next(); boolean ok = true; if(str.length() == 5){ String word = "Timur"; HashSet<Character> s = new HashSet<>(); for(int i = 0; i < word.length(); i++) s.add(word.charAt(i)); for(int i = 0; i < str.length(); i++){ if(s.contains(str.charAt(i)) == false){ ok = false; break; } s.remove(str.charAt(i)); } }else{ ok = false; } System.out.println(ok ? "YES" : "NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
9b2bc2fb8b886a856e03a7b834eb29dc
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class x { public static void main(String[] args) { int t; Scanner in = new Scanner(System.in); t = in.nextInt(); String[] r= new String[t]; for(int i=0; i<t; i++){ int n; n= in.nextInt(); in.nextLine(); String name; name = in.nextLine(); if(n==5){ if(name.contains("T") && name.contains("i") && name.contains("m") && name.contains("u") && name.contains("r")){ r[i]="YES"; } else{ r[i]="NO"; } } else{ r[i]="NO"; } } for(int j=0; j<t; j++){ System.out.println(r[j]); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
55c7e628505d197444f7c5a342c067eb
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; ;public class SpellCheck { public static void main(String[] args) { Scanner sc=new Scanner(System.in); String name="Timur"; char tempname[] = name.toCharArray(); Arrays.sort(tempname); String Sort_name=new String(tempname); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); String s=sc.next(); char temps[]=s.toCharArray(); Arrays.sort(temps); String sorts_s=new String(temps); if(sorts_s.equals(Sort_name)) System.out.println("YES"); else System.out.println("NO"); } sc.close(); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
5a566485afe21a9cd59baf9761fa8e07
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Solution{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); sc.nextLine(); String s=sc.nextLine(); char[]cr=s.toCharArray(); Arrays.sort(cr); char[] crt={'T','i','m','u','r'}; Arrays.sort(crt); int c=Arrays.compare(cr,crt); if(c==0){ System.out.println("Yes"); }else{ System.out.println("No"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
746ccaf7ec29598e933b84e23a595de0
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String args[]){ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); sc.nextLine(); char str[]={'T','i','m','u','r'}; Arrays.sort(str); while(t>0){ int n=sc.nextInt(); sc.nextLine(); String s=sc.nextLine(); if(n!=5) System.out.println("NO"); else{ char x[]=new char[5]; for(int i=0;i<5;i++) x[i]=s.charAt(i); Arrays.sort(x); int f=0; for(int i=0;i<5;i++){ if(x[i]!=str[i]){ f=1; break; } } if(f==1) System.out.println("NO"); else System.out.println("YES"); } t--; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
64b8adfe3e13b0996f99840df9ddced5
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.HashMap; import java.util.Scanner; public class problem1 { public static void main(String[] args) { Scanner input = new Scanner(System.in); String str; int x; int tests=input.nextInt(); for (int i = 0; i < tests; i++) { x=input.nextInt(); if (x!=5){ str= input.next(); System.out.println("NO"); continue; } else{ str=input.next(); if (str.contains("T")&&str.contains("i")&&str.contains("u")&&str.contains("m")&&str.contains("r")){ System.out.println("YES"); } else { System.out.println("NO"); } } } } } /* hashing is the best of all time hashing is important */
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
6159506a137913acd36e4549a64d668b
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; import java.util.Arrays; public class HelloWorld { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] ch1 = {'T', 'i', 'm', 'r', 'u'}; int n = sc.nextInt(); sc.nextLine(); String name; char[] ch2; int n2; for(int i=0;i<n;i++){ n2 = sc.nextInt(); sc.nextLine(); name = sc.nextLine(); ch2 = name.toCharArray(); Arrays.sort(ch2); if(n2 == 5){ if(Arrays.equals(ch1, ch2)){ System.out.println("YES"); } else{ System.out.println("NO"); } }else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
1d7debc1aaf855a9dc2f54eac33ce5b6
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class spellChecker { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int T = sc.nextInt(); while(T-->0) { int n = sc.nextInt(); String s = sc.next(); char[] ch= s.toCharArray(); Arrays.sort(ch); s = String.valueOf(ch); if(s.equals("Timru")) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
2abc7c7b5e5f54f629d0c884e3594ede
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class A { public static Scanner scanner = new Scanner(System.in); public static void main(String[] args) { int t = scanner.nextInt(); for (int i = 0; i < t; i++) { solve(); } } public static void solve() { int n = scanner.nextInt(); scanner.nextLine(); if (n != 5) { scanner.nextLine(); System.out.println("No"); } else { char[] s = scanner.nextLine().toCharArray(); Arrays.sort(s); if ("Timru".equals(new String(s))) { System.out.println("Yes"); } else { System.out.println("No"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
95729edff5d7e5951d695a3541732647
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class Codeforces { public static void main (String args[])throws IOException { // your code goes here Scanner sc= new Scanner(System.in); int x,s; String y; s=sc.nextInt(); while(s>0) { if(sc.hasNextInt()) x=sc.nextInt(); if(sc.hasNext()) y=sc.next(); else y=""; //System.out.println(s); if(y.length() >5) System.out.println("NO"); else { if(y.indexOf('T')!=-1) if(y.indexOf('i')!=-1) if(y.indexOf('m')!=-1) if(y.indexOf('u')!=-1) if(y.indexOf('r')!=-1){ System.out.println("YES"); s--; continue; } System.out.println("NO"); } s--; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
3d36fca526f29319e5d3f8eb30f77e42
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
/* package codechef; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ public class Codechef { public static void main (String[] args) throws java.lang.Exception { // your code goes here Scanner sc=new Scanner(System.in); int num=sc.nextInt(); while(num>=1){ int n=sc.nextInt(); String s=sc.next(); if(n==5){ if(check(s)) System.out.println("YES"); else System.out.println("NO"); } else System.out.println("NO"); num--; } } public static boolean check(String str){ String dum="Timur"; int a[]={-1,-1,-1,-1,-1}; for(int i=0;i<5;i++){ int k=dum.indexOf(str.charAt(i)); if(k==-1) return false; if(a[k]==-1) a[k]=0; else return false; } return true; } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c55fa1249b6d33ea324bb08f82d5a8cb
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.lang.*; import java.math.*; public class Codechef{ static Scanner sc= new Scanner(System.in); public static void main(String[] args){ int t=sc.nextInt(); while(t-->0){ int n=sc.nextInt(); String s = sc.next(); HashSet<Character> set = new HashSet(); set.add('T'); set.add('i'); set.add('m'); set.add('u'); set.add('r'); boolean flag=false; if(s.length()!=n){ // System.out.println(s.length()); System.out.println("No"); } else{ for(int i=0;i<n;i++){ char ch=s.charAt(i); if(set.contains(ch)){ set.remove(ch); } else{ flag=true; // System.out.println("No"); } } if(!flag){ if(!set.isEmpty()){ System.out.println("No"); } else{ System.out.println("Yes"); } } else{ System.out.println("No"); } } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
323ac2ae8683025d9398c78331ba796c
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String args[])throws Exception{ // Your code goes here BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); // HashMap<Character,Integer> set = new HashMap<>(); // set.put('T',1); // set.put('i',1); // set.put('m',1); // set.put('u',1); // set.put('r',1); HashMap<Character,Integer> set = new HashMap<>(); int t = Integer.parseInt(br.readLine()); while(t-->0){ set.put('T',1); set.put('i',1); set.put('m',1); set.put('u',1); set.put('r',1); int n = Integer.parseInt(br.readLine()); String s = br.readLine(); // boolean flag = false; int count = 0; if(n == 5){ for(int i=0;i<s.length();i++){ if(set.containsKey(s.charAt(i)) && set.get(s.charAt(i))>0){ set.put(s.charAt(i),0); count++; } } } if(count == 5){ System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 17
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c37f33bcc889a7eb31acdc06b24f8727
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class test2 { public static void main(String[] args) { int n=0; String[] name={"T","i","m","u","r"}; String ans="YES"; Scanner sc=new Scanner(System.in); int count=sc.nextInt(); sc.nextLine(); String input=""; for(int i=0;i<count;i++){ ans="YES"; n=sc.nextInt(); sc.nextLine(); input=sc.nextLine(); //if(i==171) System.out.println(input); if(n!=5){ ans="NO"; } else{ for(int j=0;j<n;j++){ if(input.indexOf(name[j])==-1){ ans="NO"; break; } } } System.out.println(ans); } sc.close(); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
516634060027ea0b7f74e5b87e44c947
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class hihi { static int res = 0; public static void main(String[] args) { Scanner scan = new Scanner(System.in); int numChecks = scan.nextInt(); for(int i = 0; i<numChecks; i++) { int[] timur = new int[5]; int len = scan.nextInt(); String str = scan.next(); if (len == 5) { for (int j = 0; j < len; j++) { if (str.charAt(j) == 84) { timur[0] = 1; } if (str.charAt(j) == 105) { timur[1] = 1; } if (str.charAt(j) == 109) { timur[2] = 1; } if (str.charAt(j) == 117) { timur[3] = 1; } if (str.charAt(j) == 114) { timur[4] = 1; } //System.out.println(Arrays.toString(timur)); } boolean t = false; for (int j = 0; j < timur.length; j++) { if (timur[j] != 1) { System.out.println("NO"); t = true; break; } } if(!t) { System.out.println("YES"); } } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
9d701ff11206268f07176fb7aa07dd29
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.*; import java.util.*; public class code { static long TIME_START, TIME_END; public static class Task { public void solve(Scanner sc, PrintWriter pw) throws IOException { //code here... int t=sc.nextInt(); for(int j=0;j<t;j++){ int n=sc.nextInt(); String st=sc.next(); if(n!=5) {pw.println("NO"); continue;} ArrayList<Character>ar=new ArrayList<>(); for(int i=0;i<5;i++){ ar.add(st.charAt(i)); } Collections.sort(ar); String ss=""; for(int i=0;i<5;i++){ ss+=ar.get(i); } if(ss.equals("Timru")) pw.println("YES"); else pw.println("NO"); } } } public static void main(String[] args) throws IOException { //Scanner sc = new Scanner(new FileReader(new File("out//input.txt"))); Scanner sc = new Scanner(System.in); //PrintWriter pw = new PrintWriter(new BufferedOutputStream(new FileOutputStream(new File("out//output.txt")))); PrintWriter pw = new PrintWriter(new BufferedOutputStream(System.out)); Runtime runtime = Runtime.getRuntime(); long usedMemoryBefore = runtime.totalMemory() - runtime.freeMemory(); TIME_START = System.currentTimeMillis(); Task t = new Task(); t.solve(sc, pw); TIME_END = System.currentTimeMillis(); long usedMemoryAfter = runtime.totalMemory() - runtime.freeMemory(); pw.close(); System.err.println("Memory increased: " + (usedMemoryAfter - usedMemoryBefore) / 1000000); System.err.println("Time used: " + (TIME_END - TIME_START) + "."); } static class Scanner { StringTokenizer st; BufferedReader br; public Scanner(InputStream s) { br = new BufferedReader(new InputStreamReader(s)); } public Scanner(FileReader s) throws FileNotFoundException { br = new BufferedReader(s); } public String next() throws IOException { while (st == null || ! st.hasMoreTokens()) st = new StringTokenizer(br.readLine()); return st.nextToken(); } public int nextInt() throws IOException { return Integer.parseInt(next()); } public long nextLong() throws IOException { return Long.parseLong(next()); } public String nextLine() throws IOException { return br.readLine(); } public double nextDouble() throws IOException { return Double.parseDouble(next()); } public boolean ready() throws IOException { return br.ready(); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
05c4de007d2948aa0a0604fd262bfd27
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.*; import java.util.*; public class Problem1 { public static void main(String[] args) { // TODO Auto-generated method stub FastIO io = new FastIO(); int T = io.nextInt(); char[] ch = {'T','i','m','u','r'}; Arrays.sort(ch); String s = new String(ch); while(T-- > 0) { int n = io.nextInt(); String str = io.next(); if (n != 5) { io.println("NO"); } else { char[] ch1 = str.toCharArray(); Arrays.sort(ch1); str = new String(ch1); if (str.equals(s)) { io.println("YES"); } else { io.println("NO"); } } } io.close(); } } class FastIO extends PrintWriter { private InputStream stream; private byte[] buf = new byte[1 << 16]; private int curChar; private int numChars; // standard input public FastIO() { this(System.in, System.out); } public FastIO(InputStream i, OutputStream o) { super(o); stream = i; } // file input public FastIO(String i, String o) throws IOException { super(new FileWriter(o)); stream = new FileInputStream(i); } // throws InputMismatchException() if previously detected end of file private int nextByte() { if (numChars == -1) { throw new InputMismatchException(); } if (curChar >= numChars) { curChar = 0; try { numChars = stream.read(buf); } catch (IOException e) { throw new InputMismatchException(); } if (numChars == -1) { return -1; // end of file } } return buf[curChar++]; } // to read in entire lines, replace c <= ' ' // with a function that checks whether c is a line break public String next() { int c; do { c = nextByte(); } while (c <= ' '); StringBuilder res = new StringBuilder(); do { res.appendCodePoint(c); c = nextByte(); } while (c > ' '); return res.toString(); } public int nextInt() { // nextLong() would be implemented similarly int c; do { c = nextByte(); } while (c <= ' '); int sgn = 1; if (c == '-') { sgn = -1; c = nextByte(); } int res = 0; do { if (c < '0' || c > '9') { throw new InputMismatchException(); } res = 10 * res + c - '0'; c = nextByte(); } while (c > ' '); return res * sgn; } public double nextDouble() { return Double.parseDouble(next()); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c04c93cc9e6fca11b106875ba1e7f372
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Problem1 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner scn = new Scanner(System.in); int T = scn.nextInt(); int[] arr; int[] arr1; String s = "Timur"; int len = s.length(); while(T-- > 0) { arr = new int[26]; arr1 = new int[26]; for (int i = 0; i < len; i++) { if (s.charAt(i) == 'T') { arr1[s.charAt(i) - 'A']++; continue; } arr[s.charAt(i) - 'a']++; } int n = scn.nextInt(); String str = scn.next(); if (n != 5) { System.out.println("NO"); } else { for (char ch : str.toCharArray()) { if (Character.isUpperCase(ch)) { arr1[ch - 'A']--; } else { arr[ch - 'a']--; } } boolean isCorrect = true; for (int i = 0; i < 26; i++) { if (arr[i] != 0 || arr1[i] != 0) { System.out.println("NO"); isCorrect = false; break; } } if (isCorrect) { System.out.println("YES"); } } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
117436fe0f36bc46dd6309b17d6b5bcf
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class Div4_1 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); // int upper = 0, lower = 0; for (int i = 0; i < n; i++) { int num = sc.nextInt(); String s = sc.next(); if (num != 5) { System.out.println("NO"); } else { // String str = sc.next(); if(s.contains("T") && s.contains("i") && s.contains("m") && s.contains("u") && s.contains("r")){ System.out.println("YES"); }else{ System.out.println("NO"); } // upper = 0; // lower = 0; } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4085662420748516e9e19390d18308fa
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Trimur { public static void main(String[] args) { String s = "Timur"; Scanner in = new Scanner(System.in); int t = in.nextInt(); boolean flag = true; while(t>0){ int n = in.nextInt(); String arr = in.next(); if(n>s.length()){ System.out.println("NO"); flag = true; t--; continue; } for(int i=0;i<s.length();i++){ if(arr.indexOf(s.charAt(i))<0){ flag = false; break; } } if(flag==true){ System.out.println("YES"); } else { System.out.println("NO"); } flag = true; t--; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
0f0680ba8737581e929ea41db22edb1f
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class CodeForces31_8 { public static void main(String[] args) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for (int i = 0; i <t ; i++) { boolean T = false; boolean I = false; boolean m = false; boolean u = false; boolean r = false; int n = in.nextInt(); String s = in.next(); if (n != 5) { System.out.println("NO"); continue; } for (int j = 0; j < Math.min(5, n); j++) { if (s.charAt(j)=='T')T=true; if (s.charAt(j)=='i')I=true; if (s.charAt(j)=='m')m=true; if (s.charAt(j)=='u')u=true; if (s.charAt(j)=='r')r=true; } if (T && I && m && u && r) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
f24248347eeae3080ad7eee2d8814f58
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 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=0;i<t;i++) { // Scanner v=new Scanner(System.in); int l = sc.nextInt(); String s = sc.next(); if (l !=5) { System.out.println("NO"); continue; } ArrayList<Character> g = new ArrayList<Character>(); g.add('T'); g.add('i'); g.add('m'); g.add('u'); g.add('r'); int cnt = 0; char c; for(int j=0;j<s.length();j++){ c=s.charAt(j); if(g.contains(c)){ cnt++; g.remove(Character.valueOf(c)); } } if (cnt==5) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a884cddb611bd947041f0c9666cc5ec8
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Problem{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int n = sc.nextInt(); char [] arr = {'T','i','m','u','r'}; Arrays.sort(arr); int a = 0; outer: while(n--!=0){ a = sc.nextInt(); String s = sc.next(); if(s.length()>5||s.length()<5) { System.out.println("NO"); continue; } char [] arr1 = s.toCharArray(); Arrays.sort(arr1); for(int i = 0 ;i<5;i++){ if(arr[i]!=arr1[i]) { System.out.println("NO"); continue outer; } } System.out.println("YES"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a3c24b2b780a2394de6de25e39a47d1e
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class A { public static void main(String[] args){ Scanner scn = new Scanner(System.in); int t = scn.nextInt(); while(t-- > 0){ int n = scn.nextInt(); String s = scn.next(); String ans = solve_editorial(s); // String ans = solve(s); System.out.println(ans); } // Set<Character> set = new HashSet<>(); // set.add('T'); // set.add('i'); // set.add('m'); // set.add('u'); // set.add('r'); // System.out.println(set); // System.out.println(set.contains('t')); // System.out.println(set.contains('T')); } public static String solve2(String s){ int n = s.length(); if(n > 5 || n < 5) { return "NO"; } Set<Character> set = new HashSet<>(); for(char c : s.toCharArray()){ set.add(c); } if(set.size() > 5 || set.size() < 5) { return "NO"; } // System.out.println(set); for(char c: "Timur".toCharArray()){ if(set.contains(c)){ set.remove(c); } else return "NO"; } return set.size() == 0 ? "YES" : "NO"; } public static String solve(String s){ int n = s.length(); if(n > 5 || n < 5) { return "NO"; } Set<Character> set = new HashSet<>(); for(char c : "Timur".toCharArray()){ set.add(c); } // System.out.println(set); for(char c: s.toCharArray()){ if(set.contains(c)){ set.remove(c); } else return "NO"; } return set.size() == 0 ? "YES" : "NO"; } public static String solve_editorial(String s){ int n = s.length(); if(n < 5 || n > 5) return "NO"; char[] arr = s.toCharArray(); Arrays.sort(arr); swap(arr, n-1, n-2); // for (int i =0 ; i < arr.length; i++) System.out.print(arr[i] + " "); // System.out.println(); for(int i= 0; i < n; i++){ // System.out.println(arr[i] + " " + "Timur".charAt(i)); if(arr[i] != "Timur".charAt(i)) return "NO"; } return "YES"; } public static void swap(char[] arr, int i, int j){ char temp = arr[i]; arr[i] = arr[j]; arr[j] = temp; } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
aff5829e9cc64bb4474f858d66416e40
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class A { public static void main(String[] args){ Scanner scn = new Scanner(System.in); int t = scn.nextInt(); while(t-- > 0){ int n = scn.nextInt(); String s = scn.next(); String ans = solve(s); System.out.println(ans); } // Set<Character> set = new HashSet<>(); // set.add('T'); // set.add('i'); // set.add('m'); // set.add('u'); // set.add('r'); // System.out.println(set); // System.out.println(set.contains('t')); // System.out.println(set.contains('T')); } public static String solve2(String s){ int n = s.length(); if(n > 5 || n < 5) { return "NO"; } Set<Character> set = new HashSet<>(); for(char c : s.toCharArray()){ set.add(c); } if(set.size() > 5 || set.size() < 5) { return "NO"; } // System.out.println(set); for(char c: "Timur".toCharArray()){ if(set.contains(c)){ set.remove(c); } else return "NO"; } return set.size() == 0 ? "YES" : "NO"; } public static String solve(String s){ int n = s.length(); if(n > 5 || n < 5) { return "NO"; } Set<Character> set = new HashSet<>(); for(char c : "Timur".toCharArray()){ set.add(c); } // System.out.println(set); for(char c: s.toCharArray()){ if(set.contains(c)){ set.remove(c); } else return "NO"; } return set.size() == 0 ? "YES" : "NO"; } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
f9fc03e41ce4cc44df0f727123a389c2
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class A { public static void main(String[] args){ Scanner scn = new Scanner(System.in); int t = scn.nextInt(); while(t-- > 0){ int n = scn.nextInt(); String s = scn.next(); String ans = solve(s); System.out.println(ans); } // Set<Character> set = new HashSet<>(); // set.add('T'); // set.add('i'); // set.add('m'); // set.add('u'); // set.add('r'); // System.out.println(set); // System.out.println(set.contains('t')); // System.out.println(set.contains('T')); } public static String solve(String s){ int n = s.length(); if(n > 5 || n < 5) { return "NO"; } Set<Character> set = new HashSet<>(); for(char c : s.toCharArray()){ set.add(c); } if(set.size() > 5 || set.size() < 5) { return "NO"; } // System.out.println(set); for(char c: "Timur".toCharArray()){ if(set.contains(c)){ set.remove(c); } else return "NO"; } return set.size() == 0 ? "YES" : "NO"; } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
ed8d2a9f8808d64a0313a5acacd68e93
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class A { public static void main(String[] args){ Scanner scn = new Scanner(System.in); int t = scn.nextInt(); while(t-- > 0){ int n = scn.nextInt(); String s = scn.next(); String ans = solve(s); System.out.println(ans); } // Set<Character> set = new HashSet<>(); // set.add('T'); // set.add('i'); // set.add('m'); // set.add('u'); // set.add('r'); // System.out.println(set); // System.out.println(set.contains('t')); // System.out.println(set.contains('T')); } public static String solve(String s){ int n = s.length(); if(n > 5 || n < 5) { return "NO"; } Set<Character> set = new HashSet<>(); for(char c : s.toCharArray()){ set.add(c); } // System.out.println(set); for(char c: "Timur".toCharArray()){ if(set.contains(c)){ set.remove(c); } else return "NO"; } return set.size() == 0 ? "YES" : "NO"; } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
5203f22f944955bd12c35bfa2554a9fa
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.Scanner; public class JavaApplication182 { int check(char a){ if (a=='T') return 1; if (a=='i') return 2; if (a=='m') return 3; if (a=='u') return 4; if (a=='r') return 5; else return 0; } public static void main(String[] args) { Scanner s=new Scanner (System.in); int t=s.nextInt(); JavaApplication182 k= new JavaApplication182 (); for (int i=0;i<t;i++) { int n=s.nextInt(); String name =s.next(); if (n==5) { int c[]=new int[n]; for (int j=0;j<n;j++) { c[j]=k.check(name.charAt(j)); } Arrays.sort(c); int h=1; for (int j=0;j<n;j++) { if (c[j]!=j+1) { h=0; break; } } if (h==1) System.out.println("Yes"); else System.out.println("No"); } else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
bbbc393c7f9e9872eddba607cda01cfb
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); String k = "Timru"; while(w-->0) { int a = t.nextInt(); String s = t.next(); //String p =""; char [] d = s.toCharArray(); Arrays.sort(d); StringBuilder b = new StringBuilder(); // String sss= ss.copyValueOf(d); for(char hh : d) { b.append(hh); } String l= b.toString(); if(k.equals(l)) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
347abbe02727bbf34d55e5a7044a343b
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); String k = "Timru"; while(w-->0) { int a = t.nextInt(); String s = t.next(); //String p =""; char [] d = s.toCharArray(); Arrays.sort(d); String ss = new String(); String sss= ss.copyValueOf(d); if(k.equals(sss)) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
bdef945b1b9bed4df28531d339b97670
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); String k = "Timru"; while(w-->0) { int a = t.nextInt(); String s = t.next(); //String p =""; char [] d = s.toCharArray(); Arrays.sort(d); // String ss = new String(d); String sss= String.valueOf(d); if(k.equals(sss)) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e4a26e0d94a78cbd542b28d6886da661
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); String k = "Timru"; while(w-->0) { int a = t.nextInt(); String s = t.next(); //String p =""; char [] d = s.toCharArray(); Arrays.sort(d); // String ss = new String(d); String sss = String.valueOf(d); if(sss.equals(k)) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
64431d7ea969553cfc169f1c0605301d
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); String k = "Timru"; while(w-->0) { int a = t.nextInt(); String s = t.next(); //String p =""; char [] d = s.toCharArray(); Arrays.sort(d); String ss = new String(d); if(ss.equals(k)) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4d6a2f0f7203b9ca60cd63474d4d2277
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); String k = "Timru"; while(w-->0) { int a = t.nextInt(); String s = t.next(); //String p =""; char [] d = s.toCharArray(); Arrays.sort(d); s = new String(d); if(s.equals(k)) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
95b1ac471df9150ff9a84a1298aa1107
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args) { Scanner t = new Scanner(System.in); int w = t.nextInt(); String k = "Timru"; while(w-->0) { int a = t.nextInt(); String s = t.next(); String p =""; char [] d = s.toCharArray(); Arrays.sort(d); for(int i=0;i<d.length;i++) { p = p+d[i]; } if(p.equals(k)) { System.out.println("YES"); } else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
f9a7b218be0cc71409f3e2e66bb3ded6
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; import static java.lang.Math.max; import static java.lang.Math.min; import static java.lang.Math.abs; import static java.lang.System.out; import java.util.*; import java.io.*; import java.math.*; public class Solution{ public static void main(String [] args){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); String s = sc.next(); if(n!=5) System.out.println("NO"); else { char [] ref = s.toCharArray(); int cnt = 0; int cnt2 =0; int cnt3 = 0; int cnt4 = 0; int cnt5 = 0; for(char c : ref){ if(c=='T') { cnt++; } else if(c=='i'){ cnt2++; } else if(c=='m'){ cnt3++; } else if(c=='u'){ cnt4++; } else if(c=='r'){ cnt5++; } } if(cnt==1 && cnt2==1 && cnt3==1 && cnt4==1 && cnt5==1) System.out.println("YES"); else System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
61bdd507af785c9bb1ffcffa39f04958
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class Codeforces{ public static void main(String[]args) throws Exception{ Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); String st=sc.next(); if(st.length()<5 || st.length()>5) { System.out.println("NO"); } else{ //ArrayList<Character>ss=new ArrayList<Character>(); HashSet<Character> ss = new HashSet<Character>(); ss.add('T'); ss.add('i'); ss.add('m'); ss.add('u'); ss.add('r'); boolean kp=true; for(int i=0;i<st.length();i++) { if(ss.contains(st.charAt(i))==false) { System.out.println("NO"); kp=false; break; } else{ ss.remove(st.charAt(i)); } } if(kp==true) { System.out.println("YES"); } } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
9fd1e8b901fb546a26fb15fdc392baac
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class ProblemA { public static void main(String[] args){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0){ int n = sc.nextInt(); String s = sc.next(); int tcount = 0; int icount = 0; int mcount = 0; int ucount = 0; int rcount = 0; for(int i=0;i<s.length();i++){ if(s.charAt(i) == 'T'){ tcount = 1; }else if(s.charAt(i) == 'i'){ icount = 1; }else if(s.charAt(i) == 'm'){ mcount = 1; } else if(s.charAt(i) == 'u'){ ucount = 1; }else if(s.charAt(i) == 'r'){ rcount = 1; } } if(tcount == 1 && mcount == 1 && icount == 1 && ucount == 1 && rcount == 1 && n == 5){ System.out.println("Yes"); }else{ System.out.println("No"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
80aa80e2102025a847716591cc494167
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
//import java.util.HashSet; import java.util.Scanner; //import java.util.Set; //import java.util.Arrays; //import java.util.HashMap; public class JavaApplication1 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); for (int i = 0; i < n; i++) { boolean t = true; int temp = s.nextInt(); String text = s.next(); boolean arr[] = new boolean[5]; if (temp > 5 || temp < 5) { System.out.println("NO"); } else { for (int j = 0; j < temp; j++) {//Timur if (text.charAt(j) == 'T') { arr[0] = true; } else if (text.charAt(j) == 'i') { arr[1] = true; } else if (text.charAt(j) == 'm') { arr[2] = true; } else if (text.charAt(j) == 'u') { arr[3] = true; } else if (text.charAt(j) == 'r') { arr[4] = true; } } for (int x = 0; x < 5; x++) { if (!arr[x]) { t = false; break; } } if (t) { System.out.println("YES"); } else { System.out.println("NO"); } } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
fa989d1bbdbdc1080ef93cafcb433cc5
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scn=new Scanner (System.in); int t=scn.nextInt(); while(t-->0){ int l=scn.nextInt(); String s=scn.next(); if(s.contains("T") && s.contains("i") && s.contains("m") && s.contains("u") && s.contains("r") && s.length()==5) { System.out.println("YES");} else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
5d3b1a455f8308bad984d9ae3d7f4c5e
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.IOException; import java.io.*; import java.util.Arrays; public class Codeforces1a { public static void main(String[] args)throws IOException { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); int n=Integer.parseInt(br.readLine().trim()); char[]st= "Timur".toCharArray(); Arrays.sort(st); while(n!=0) { int le = Integer.parseInt(br.readLine().trim()); String name = (br.readLine().trim()); boolean flag=true; if (le!=5) { flag=false; } else { char[]as=name.toCharArray(); Arrays.sort(as); for (int i = 0; i <5 ; i++) { if (st[i]!=as[i]){ flag=false; break; } } } if (flag==false) System.out.println("NO"); else System.out.println("YES"); n--; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
13307e91dc8ff70ed23507f80a35bb98
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class Main { static FastReader in=new FastReader(); static final Random random=new Random(); static long mod=1000000007L; static HashMap<String,Integer>map=new HashMap<>(); public static void main(String args[]) throws IOException { int t=in.nextInt(); StringBuilder res=new StringBuilder(); Set<Character> set=new HashSet<>(); loop: while(t-->0) { int n= in.nextInt(); String str=in.nextLine(); if (str.length()>5){ res.append("NO"+"\n"); }else{ for (char ch:str.toCharArray() ) { if (ch == 'T' || ch =='i' || ch =='m' || ch == 'u' || ch =='r'){ set.add(ch); } } if(set.size() !=5)res.append("NO"+"\n"); else res.append("YES"+"\n"); } if (!set.isEmpty())set.clear(); } print(res); } static int max(int a, int b) { if(a<b) return b; return a; } static void ruffleSort(int[] a) { int n=a.length; for (int i=0; i<n; i++) { int oi=random.nextInt(n), temp=a[oi]; a[oi]=a[i]; a[i]=temp; } Arrays.sort(a); } static < E > void print(E res) { System.out.println(res); } static int gcd(int a,int b) { if(b==0) { return a; } return gcd(b,a%b); } static int lcm(int a, int b) { return (a / gcd(a, b)) * b; } static int abs(int a) { if(a<0) return -1*a; return a; } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader(new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } int [] readintarray(int n) { int res [] = new int [n]; for(int i = 0; i<n; i++)res[i] = nextInt(); return res; } long [] readlongarray(int n) { long res [] = new long [n]; for(int i = 0; i<n; i++)res[i] = nextLong(); return res; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
7a48f587af0c7c1bde22a651e1b6ed79
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.ArrayList; import java.util.Collections; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); ArrayList<Character> all = new ArrayList<>(); all.add('T'); all.add('i'); all.add('m'); all.add('u'); all.add('r'); Collections.sort(all); while(t-->0) { int n = sc.nextInt(); String s = sc.next(); int ct=0; if(n!=5) { System.out.println("No"); } else { ArrayList<Character> ans = new ArrayList<>(); for(int i=0;i<n;i++) { ans.add(s.charAt(i)); } Collections.sort(ans); if(ans.equals(all)) { System.out.println("Yes"); } else { System.out.println("No"); } } } }}
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
6a9887befad9013b3de24532fb5202c9
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.Random; import java.util.StringTokenizer; public class Main { public static void main(String[] args) { FastScanner fs=new FastScanner(); PrintWriter out=new PrintWriter(System.out); int t=fs.nextInt(); for (int tt=0; tt<t; tt++) { int n=fs.nextInt(); String s=fs.next(); int T=0; int i=0; int m=0; int u=0; int r=0; for(int j=0;j<n;j++){ if(s.charAt(j)=='T' ){ T++; } if(s.charAt(j)=='i'){ i++; } if(s.charAt(j)=='m'){ m++; } if(s.charAt(j)=='u'){ u++; } if(s.charAt(j)=='r'){ r++; } } int ans=T+i+m+u+r; if(T==1 && m==1 && u==1 && i==1 && r==1 && Math.abs(n-ans)==0){ out.println("YES"); } else{ out.println("NO"); } } out.close(); } static final Random random=new Random(); static final int mod=1_000_000_007; static void ruffleSort(int[] a) { int n=a.length;//shuffle, then sort for (int i=0; i<n; i++) { int oi=random.nextInt(n), temp=a[oi]; a[oi]=a[i]; a[i]=temp; } Arrays.sort(a); } static long add(long a, long b) { return (a+b)%mod; } static long sub(long a, long b) { return ((a-b)%mod+mod)%mod; } static long mul(long a, long b) { return (a*b)%mod; } static long exp(long base, long exp) { if (exp==0) return 1; long half=exp(base, exp/2); if (exp%2==0) return mul(half, half); return mul(half, mul(half, base)); } static long[] factorials=new long[2_000_001]; static long[] invFactorials=new long[2_000_001]; static void precompFacts() { factorials[0]=invFactorials[0]=1; for (int i=1; i<factorials.length; i++) factorials[i]=mul(factorials[i-1], i); invFactorials[factorials.length-1]=exp(factorials[factorials.length-1], mod-2); for (int i=invFactorials.length-2; i>=0; i--) invFactorials[i]=mul(invFactorials[i+1], i+1); } static long nCk(int n, int k) { return mul(factorials[n], mul(invFactorials[k], invFactorials[n-k])); } static void sort(int[] a) { ArrayList<Integer> l=new ArrayList<>(); for (int i:a) l.add(i); Collections.sort(l); for (int i=0; i<a.length; i++) a[i]=l.get(i); } static class FastScanner { BufferedReader br=new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st=new StringTokenizer(""); String next() { while (!st.hasMoreTokens()) try { st=new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } int[] readArray(int n) { int[] a=new int[n]; for (int i=0; i<n; i++) a[i]=nextInt(); return a; } long nextLong() { return Long.parseLong(next()); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
81452d6b280348652a6bbe08771654d6
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; /** * * @author edi21 */ public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int tt = Integer.parseInt(sc.nextLine()); String nombre[] = {"T", "i", "m", "u", "r"}; boolean letras[] = new boolean[5]; for (int i = 0; i < 5; i++) { letras[i] = false; } for (int i = 0; i < tt; i++) { int nn = Integer.parseInt(sc.nextLine()); String ss = sc.nextLine(); boolean val = true; for (int j2 = 0; j2 < 5; j2++) { letras[j2] = false; } for (int j = 0; j < nn; j++) { String lt = ss.substring(j, j + 1); boolean val2 = false; for (int k = 0; k < 5; k++) { if (lt.equals(nombre[k])) { if (letras[k] == true) { val2 = false; k = 5; } else { letras[k] = true; k = 5; val2 = true; } } } if (val2 == false) { val = false; j = nn; } } for (int k = 0; k < 5; k++) { if (letras[k] == false) { val = false; } } if (val) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
988bdb4ff7b13465aedf150bc04393d4
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args)throws IOException { // InputStreamReader sr=new InputStreamReader(System.in); // BufferedReader br=new BufferedReader(sr); Scanner sc=new Scanner(System.in); int t,n,k=0,f=0; String h="Timur"; t=sc.nextInt(); for(f=1;f<=t;f++) { n=0; n=sc.nextInt(); sc.nextLine(); String s=sc.nextLine(); k=0; for (int i = 0; i < h.length(); i++) { if(n==5) { k=0; for(int j=0;j<s.length();j++) { if(s.charAt(j) == h.charAt(i)) { k++; } } if(k!=1) { k=0; break; } } else { break; } } if(k!=0) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4915ece8e6b2999382d3129346f3a985
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
/*package whatever //do not write package name here */ import java.util.*; import java.io.*; public class GFG { public static void main (String[] args) { A(); } public static void A(){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int i = 0 ; i<t; i++){ String tim = "Timur"; int [] count = new int[150]; for(char ch : tim.toCharArray()){ count[ch]++; } boolean res = true; int l = sc.nextInt(); String s = sc.next(); for(char ch : s.toCharArray()) count[ch]--; for(int u : count){ if(u != 0){ res = false; } } if(res) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d311d682ac137ce9d6186aca1d7208b9
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Solution{ public static void main(String args[]){ Scanner sc = new Scanner(System.in); int t = sc.nextInt(); for(int k=0;k<t;k++){ int n =sc.nextInt(); String s = sc.next(); String str = "Timur"; char c[]=str.toCharArray(); Arrays.sort(c); String str_sorted=new String(c); if(n==5){ char cha[]=s.toCharArray(); Arrays.sort(cha); String s_sorted=new String(cha); for(int i=0;i<n;i++){ if(s_sorted.charAt(i)!=str_sorted.charAt(i)){ System.out.println("No"); break; } if(i==n-1){ System.out.println("YEs"); } } } else{ System.out.println("No"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4e181f2067feaa5efb2e9d39ed0e600c
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.*; import java.util.*; public class Main { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); String s = sc.next(); char arr[] = s.toCharArray(); Arrays.sort(arr); s = new String(arr); String finalString = "Timru"; if (finalString.equals(s)) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4cac7706c60ae6017d76f29b340b4d8e
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ import java.io.*; 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="Timur"; int n=s.length(); int n1=sc.nextInt(); String s1=sc.next(); //System.out.println(s1+" "+s); int k=0; if(n==n1) { for(int i=0;i<n;i++) { k=0; for(int j=0;j<n;j++) { if(s.charAt(i)==s1.charAt(j)) { // System.out.print(s1.charAt(j)+" "); k=1; break; } } if(k!=1) { break; } } if(k==0) { System.out.println("No"); } else{ System.out.println("Yes"); } } else { System.out.println("No"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4094255a11e7076dd66e867f4403c579
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class code { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while(t-->0) { int n = sc.nextInt(); String str = sc.next(); if(n!=5) { System.out.println("NO"); continue; } boolean flag=true; HashSet<Character> s = new HashSet<>(); s.add('T'); s.add('i'); s.add('m'); s.add('u'); s.add('r'); for(int i=0; i<n; i++) { char ch = str.charAt(i); if(!s.contains(ch)) { flag=false; break; } else { s.remove(ch); } } if(flag==true) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
b9bc5fe43dbcb829a9b67827770c75c4
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class Main{ public static void main(String args[]){ Scanner s = new Scanner(System.in); int T = s.nextInt(); while(T>0){ int n = s.nextInt(); String str1 = s.next(); if(n!=5){ System.out.println("no"); }else{ if(str1.contains("T") && str1.contains("i") && str1.contains("m") && str1.contains("u")&&str1.contains("r")){ System.out.println("yes"); }else{ System.out.println("no"); } } T = T-1; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
444810c002883e2aaefeaeac819e9bd0
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t>0){ int a=sc.nextInt(); String b=sc.next(); if(a==5 && b.contains("T") && b.contains("i") && b.contains("m") && b.contains("u") && b.contains("r")){ System.out.println("yes"); } else{ System.out.println("no"); } t = t-1; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
320d687e6518ffb9c1c583e43b6fd060
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0){ int a=sc.nextInt(); String b=sc.next(); if(a==5 && b.contains("T") && b.contains("i") && b.contains("m") && b.contains("u") && b.contains("r")){ System.out.println("yes"); } else{ System.out.println("no"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
4681fc7a5a5f7001f61f6bf65e0b0289
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Timur_Codeforces { public static void main(String args[]) { Scanner sc=new Scanner(System.in); int t=sc.nextInt(); while(t-->0) { int n=sc.nextInt(); // sc.nextLine(); String st=sc.next(); if(n>5) { System.out.println("No"); continue; } char a1[]=st.toCharArray(); int a=0,b=0,c=0,d=0,e=0; for(char ch:a1) { if(ch=='i') a++; else if(ch=='T') b++; else if(ch=='r') c++; else if(ch=='m') d++; else if(ch=='u') e++; } if(a==1&&b==1&&c==1&&d==1&&e==1) System.out.println("Yes"); else System.out.println("No"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
639294a43b6ea4677affca97a370694c
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Arrays; public class tim { public static void main(String[] args) throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int a = Integer.parseInt(br.readLine()); char[] chars = new char[5]; chars[0] = 'T'; chars[1] = 'i'; chars[2] = 'm'; chars[3] = 'r'; chars[4] = 'u'; for(int alpha = 0; alpha < a; alpha++){ int n = Integer.parseInt(br.readLine()); String k = br.readLine(); if(n == 5){ char[] inputs = k.toCharArray(); Arrays.sort(inputs); if(Arrays.equals(inputs, chars)){ System.out.println("YES"); }else{ System.out.println("NO"); } }else{ System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
505fd5d8d1916a9cd3e5ed527f0a281f
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; /** * * @author ADNAN MUHAISEN */ public class JavaApplication98 { public static boolean isEqual(char x[]){ char a[]={'T','i','m','r','u'}; if(x.length!=a.length) return false; for (int i = 0; i <x.length; i++) { if(a[i]!=x[i]) return false; } return true; } public static void main(String[] args) { Scanner in=new Scanner(System.in); int t=in.nextInt(); for (int i = 1; i <=t; i++) { int n=in.nextInt(); String str=in.next(); char ch[]=new char [n]; for (int j = 0; j <ch.length; j++) { ch[j]=str.charAt(j); } java.util.Arrays.sort(ch); if(isEqual(ch)) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
1b12849b8b075b59b66fb314c0ed89de
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; import java.math.*; public class Substitute { //Global Declarations final static Random random = new Random(); final static FastReader in = new FastReader(); final static PrintWriter out = new PrintWriter(System.out); public static String solve() { //Long range is -10^18 to 10^18 and is 64 bit (8 bytes) //Integer range is ~~ -2 * 10^9(-2^31) to 2 * 10^9(2^31 - 1) and is 32 bit (4 bytes) //Java executes 5 * 10^7 operations per second int n = in.nextInt(),i; String s1 = in.next(); String s2 = in.next(); for(i=0;i<n;++i){ if(s1.charAt(i) == s2.charAt(i)) continue; else if((s1.charAt(i) == 'G' && s2.charAt(i) == 'B') || (s1.charAt(i) == 'B' && s2.charAt(i) == 'G')){ continue; } else return "NO"; } return "YES"; } public static void solve2(int a[]){ } public static void reverseLong(long a[]) { int i,n=a.length,j=n-1; long temp; for(i=0;i<n/2;++i){ temp = a[i]; a[i] = a[j]; a[j] = temp; --j; } } public static void reverseInt(int a[]) { int i,n=a.length,j=n-1,temp; for(i=0;i<n/2;++i){ temp = a[i]; a[i] = a[j]; a[j] = temp; --j; } } public static void ruffleLong(long a[]) { //shuffle, then sort int i,j,n=a.length; long temp; for (i=0; i<n; i++) { j = random.nextInt(n); temp = a[i]; a[i] = a[j]; a[j] = temp; } Arrays.sort(a); } public static void ruffleInt(int a[]) { //shuffle, then sort int i,j,n=a.length,temp; for (i=0; i<n; i++) { j = random.nextInt(n); temp = a[i]; a[i] = a[j]; a[j] = temp; } Arrays.sort(a); } public static void main(String ... args) throws IOException { // << --> multiply // >> --> divide //variable_name <<= 1 --> (variable)multiply by 2 //variable_name >>= 1 --> (variable)divide by 2 //2<<3 --> (multiply)2 * 2^3 --> 16; //6>>1 --> (divide)6 / 2^1 --> 3; /* int n=100000,i=0,j; boolean prime_array [] = new boolean [n+1]; int primes[] = new int[9592]; while(i<=n) prime_array[i++] = true; prime_array[0]=false; prime_array[1]=false; i=2; while(i*i<=n){ if(prime_array[i] == true){ for(j=2;i*j<=n;j++) prime_array[i*j] = false; } i++; } j=0; for(i=0;i<=n;i++){ if(prime_array[i] == true) primes[j++] = i; } //out.println(Arrays.toString(primes)); int temp,p=0,ct=1; long val=1,vals=val; for(i=1;i<=100000;++i){ val = (i*(i+1))/2; vals = val; //out.println(vals); ct=1; j=0; temp = primes[j]; while(temp*temp <= val){ while(val%temp == 0){ val/=temp; ++p; } ct *= (p+1); temp = primes[++j]; p=0; } if(val>1) ct*=2; if(ct>500) break; //out.println(ct); } if(ct>500) out.println(vals); */ int tt = in.nextInt(); while(tt-->0){ int n = in.nextInt(); String s = in.next(); if(n < 5 || n > 5){ out.println("NO"); continue; } HashMap<Character,Integer> mp = new HashMap<>(); for(char c: s.toCharArray()) mp.put(c,mp.getOrDefault(c,0)+1); if(mp.get('T') != null && mp.get('T') == 1 && mp.get('i') != null && mp.get('i') == 1 && mp.get('m') != null && mp.get('m') == 1 && mp.get('u') != null && mp.get('u') == 1 && mp.get('r') != null && mp.get('r') == 1) out.println("YES"); else out.println("NO"); } out.close(); } static class FastReader { BufferedReader br; StringTokenizer st; public FastReader() { br = new BufferedReader( new InputStreamReader(System.in)); } String next() { while (st == null || !st.hasMoreElements()) { try { st = new StringTokenizer(br.readLine()); } catch (IOException e) { e.printStackTrace(); } } return st.nextToken(); } int nextInt() { return Integer.parseInt(next()); } long nextLong() { return Long.parseLong(next()); } double nextDouble() { return Double.parseDouble(next()); } String nextLine() { String str = ""; try { str = br.readLine(); } catch (IOException e) { e.printStackTrace(); } return str; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
7d10833e16af3f5d6040a0e9147eb8ff
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) throws Exception { Scanner sc= new Scanner(System.in); //System.in is a standard input stream int T = sc.nextInt(); while(T-->0){ int n = sc.nextInt(); sc.nextLine(); String s= sc.next(); char[] ch=s.toCharArray(); Arrays.sort(ch); String st=String.valueOf(ch); if(st.equals("Timru")) System.out.println("YES"); else System.out.println("NO"); } sc.close(); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
9cedc3b117aac742d90fa0715154d5af
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Solution { public static void main (String[] args) { Scanner sc = new Scanner(System.in); int t = sc.nextInt(); while (t-- > 0) { HashSet<Character> set = new HashSet<>(); set.add('T'); set.add('i'); set.add('m'); set.add('u'); set.add('r'); int n = sc.nextInt(); sc.nextLine(); String s = sc.nextLine(); if (n != 5) { System.out.println("NO"); continue; } int i = 0; for (i = 0; i < n; i++) { if (!set.contains(s.charAt(i))) { System.out.println("NO"); break; } else set.remove(s.charAt(i)); } if (i == n) System.out.println("YES"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
218a4e9616733cafcd04c77c464d4f53
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class JavaApplication1 { public static void main(String[] args) { Scanner s = new Scanner(System.in); String ti ="Timur"; int n =s.nextInt(); for(int i =1;i<=n;i++) { boolean notFound =false; int len = s.nextInt(); String str = s.next(); Set<Integer> hash = new HashSet<>(); for(int k =0;k<=str.length()-1;k++) { hash.add(str.charAt(k)-0); } if(len == 5){ for(int k =0;k<=ti.length()-1;k++) { if(!hash.contains(ti.charAt(k)-0)){ notFound = true; } } if(notFound) System.out.println("NO"); else System.out.println("YES"); } else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d5654b0a4d47cf9ad61bcb7164940316
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int j=0;j<n;j++){ int size=sc.nextInt(); String s=sc.next(); int cntT=0,cnti=0,cntm=0,cntu=0,cntr=0; for(int i=0;i<s.length();i++){ if(s.charAt(i)=='T') cntT++; else if(s.charAt(i)=='i') cnti++; else if(s.charAt(i)=='m') cntm++; else if(s.charAt(i)=='u') cntu++; else if(s.charAt(i)=='r') cntr++; } if(s.length()==5 && cntT==1 && cnti==1 && cntm==1 && cntu==1 && cntr==1) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d5a1ee84d5a9c6f853dedbfba15ddc7d
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.*; import java.util.*; public class SpellCheck { public static void main(String[] args) { Scanner sc= new Scanner(System.in); int t=sc.nextInt(); String str="Timur"; for(int j=0;j<t;j++) { int n=sc.nextInt(); String s=sc.next(); if(n>5 || n<5) System.out.println("NO"); else { HashSet<Character> hs=new HashSet<Character>(); for(int i=0;i<n;i++) hs.add(s.charAt(i)); String output="YES"; for(int i=0;i<5;i++) { if(hs.contains(str.charAt(i))); else output="NO"; } System.out.println(output); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
35faf334e191fad118a27aa207f7dc64
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.Scanner; public class Bridges { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int tc=sc.nextInt(); while(tc-->0) { int n = sc.nextInt(); String s = sc.next(); String str = "Timur"; char[] ns =s.toCharArray(); Arrays.sort(ns); char[] nstr =str.toCharArray(); Arrays.sort(nstr); if(Arrays.equals(ns,nstr)) System.out.println("YES"); else System.out.println("NO"); } // HashMap<Character,Integer> map=new HashMap<>(); // for(int i=0;i<str.length();i++) // map.put(str.charAt(i),map.getOrDefault(str.charAt(i),0)+1); // int len = 5; // boolean falg=true; // if(s.length()!=len) // { // System.out.println("NO"); // } // else // { // for(int i=0;i<s.length();i++) // { // if(map.containsKey(s.charAt(i))) // { // int freq=map.get(s.charAt(i)); // if(freq-1==0) // map.remove(s.charAt(i)); // else // { // map.remove(s.charAt(i)); // map.put(s.charAt(i),freq-1); // } // } // else // { // falg=false; // System.out.println("NO"); // } // } // if(falg==true) // System.out.println("YES"); // } // // } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
b42b298435fa3bb7a84f1b8b465ca27d
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.HashSet; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String nameToMatch = "Timur"; int count =0; boolean flag ; HashSet<Character> set = new HashSet<>(); for(int i=0;i<nameToMatch.length(); i++){ set.add(nameToMatch.charAt(i)); } int t = Integer.parseInt(sc.nextLine()); for(int i=0;i<t; i++){ for(int k=0;k<nameToMatch.length();k++){ set.add(nameToMatch.charAt(k)); } flag = false; String len = sc.nextLine(); String name = sc.nextLine(); if(name.length() == nameToMatch.length()) { for (int j = 0; j < name.length(); j++) { if(!set.contains(name.charAt(j))){ System.out.println("NO"); flag = true; break; }else { set.remove(name.charAt(j)); } } if(set.isEmpty() && !flag){ System.out.println("YES"); } }else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
c270d2f6301f81f8059f1e674297da6d
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int t = Integer.parseInt(sc.nextLine()); for (int i = 0; i < t; i++) { if (Integer.parseInt(sc.nextLine()) != 5) { sc.nextLine(); System.out.println("NO"); } else { char[] letters = sc.nextLine().toCharArray(); Arrays.sort(letters); String sortedName = new String(letters); if ("Timru".equals(sortedName)) { System.out.println("YES"); } else { System.out.println("NO"); } } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
79885cb43164e51cb08367e5bdb10b18
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner ob = new Scanner(System.in); int t = ob.nextInt(); while (t-- > 0) { int l = ob.nextInt(); String s = ob.next(); if (s.contains("T") && s.contains("i") && s.contains("m") && s.contains("u") && s.contains("r") && s.length() == 5) { System.out.println("YES"); } else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
a9a3a4127c065028b0a140e41ccd7345
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Abc { public static void main(String args[]) { Scanner in = new Scanner(System.in); int t = in.nextInt(); for(int p=1;p<=t;p++) { int n = in.nextInt(); String s = in.next(); if(n<5) { System.out.println("NO"); continue; } HashMap<Character,Integer> map = new HashMap<>(); map.put('T',1); map.put('i',1); map.put('m',1); map.put('u',1); map.put('r',1); int flag=0; for(int i=0;i<n;i++) { if(map.containsKey(s.charAt(i))) map.remove(s.charAt(i)); else { flag = 1; break; } } if(flag==0) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
52538a9dfb6c1d9e24c14d032c8d35e3
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int test = s.nextInt(); int tam; String text ; for (int i = 0; i < test; i++) { tam = s.nextInt(); s.nextLine(); char [] a = s.next().toCharArray(); Arrays.sort(a); text = String.valueOf(a); if(tam == 5) { if (text.length() == 5 && text.equals("Timru")) { System.out.println("YES"); } else { System.out.println("NO"); } } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d35efafbc8dd02b2b1058c13270ecad9
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int testCases = sc.nextInt(); for (int i = 0; i < testCases; i++) { int tamaño = sc.nextInt(); String nombre = sc.next(); char [] temp = nombre.toCharArray(); Arrays.sort(temp); String organizado = new String (temp); if(organizado.contains("Timru") && tamaño==5){ System.out.println("YES"); }else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e6ae2f5602796662c543804fd547cc79
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner kb = new Scanner(System.in); int t = kb.nextInt(); kb.nextLine(); for (int ti = 0; ti < t; ti++) { int n = kb.nextInt(); kb.nextLine(); String s = kb.nextLine(); if (s.length() == 5) { String word = "Timur"; boolean error = false; for (int i = 0; i < 5; i++) { if (s.indexOf(word.charAt(i)) == -1) { error = true; break; } } System.out.println(error ? "NO" : "YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
6a69f0e9b1935a886dd9fe9a331f068f
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.lang.String; import java.util.Arrays; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int cases = scan.nextInt(); for (int caseNum = 0; caseNum < cases; caseNum++) { solve(scan); } } private static void solve(Scanner scan) { int length = scan.nextInt(); String name = "Timur"; String nickName = scan.next(); if (length != 5) { System.out.println("NO"); } else { char[] sortName = name.toCharArray(); Arrays.sort(sortName); char[] sortNickName = nickName.toCharArray(); Arrays.sort(sortNickName); if (new String(sortName).equals(new String(sortNickName))) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
40bbe9fcc95671234443fff2e3218095
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.lang.String; import java.util.Arrays; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int cases = scan.nextInt(); for (int caseNum = 0; caseNum < cases; caseNum++) { solve(scan); } } private static void solve(Scanner scan) { int length = scan.nextInt(); String name = "Timur"; String nickName = scan.next(); char sortName[] = name.toCharArray(); Arrays.sort(sortName); char sortNickName[] = nickName.toCharArray(); Arrays.sort(sortNickName); if(new String(sortName).equals(new String(sortNickName))){ System.out.println("YES"); }else{ System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
2ed280ede82b9098eae1abf30143aea2
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.*; import java.util.Arrays; public class Main { public static void main(String[] args) throws NumberFormatException, IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String clave="Timur"; char[] cOriginal=clave.toCharArray(); Arrays.sort(cOriginal); String ejemplo; char[] ejC = new char[clave.length()]; int n=Integer.parseInt(in.readLine()); int lE; for (int i = 0; i < n; i++) { lE=Integer.parseInt(in.readLine()); ejemplo=in.readLine(); if(clave.length()==lE) { ejC=ejemplo.toCharArray(); Arrays.sort(ejC); if(Arrays.compare(cOriginal, ejC)==0) {System.out.println("YES");} else {System.out.println("NO");} }else {System.out.println("NO");} } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
79c35c0bb6ef8ce5707cc38ac2212221
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.HashMap; import java.util.Scanner; public class Main { public static int countDiffChars(String word) { HashMap<Character, Integer> map = new HashMap<Character, Integer>(); for (int i = 0; i < word.length(); i++) { char c = word.charAt(i); if (map.containsKey(c)) { map.put(c, map.get(c) + 1); } else { map.put(c, 1); } } int count = map.size(); // for (Character c : map.keySet()) { // // System.out.println(c + " " + map.get(c)); // if (map.get(c) == 1) { // count++; // } // } return count; } public static void mainA(String[] args) { Scanner leer = new Scanner(System.in); int diffChars = countDiffChars(leer.next()); if (diffChars % 2 == 0) { System.out.println("CHAT WITH HER!"); } else { System.out.println("IGNORE HIM!"); } leer.close(); } public static int bananas(int n, int k, int w) { int total = 0; for (int i = 1; i <= w; i++) { total += i * k; } return total - n; } public static void mainB(String[] args) { Scanner leer = new Scanner(System.in); String[] line = leer.nextLine().split(" "); int k = Integer.parseInt(line[0]); int n = Integer.parseInt(line[1]); int w = Integer.parseInt(line[2]); int output = bananas(n, k, w); System.out.println(output > 0 ? output : 0); leer.close(); } public static void spellCheck() { } public static void main(String[] args) { Scanner leer = new Scanner(System.in); int t = Integer.parseInt(leer.nextLine()); for (int i = 0; i < t; i++) { int n = Integer.parseInt(leer.nextLine()); String s = leer.nextLine(); String[] chars = s.split(""); if (n != 5) { System.out.println("NO"); continue; } if (chars.length != 5) { System.out.println("NO"); continue; } HashMap<String, Integer> map = new HashMap<String, Integer>(); for (String c : chars) { if (map.containsKey(c)) { map.put(c, map.get(c) + 1); } else { map.put(c, 1); } } if (map.size() == 5 && map.containsKey("T") && map.containsKey("u") && map.containsKey("i") && map.containsKey("m") && map.containsKey("r")) { System.out.println("YES"); } else { System.out.println("NO"); } } leer.close(); } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e658984e1880e9b0d28aacaa063ace37
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.lang.reflect.Array; import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner s = new Scanner(System.in); int test = s.nextInt(); int tam; List name = new ArrayList(); name.add('T'); name.add('i'); name.add('m'); name.add('u'); name.add('r'); String text = " "; int dif ; for (int i = 0; i < test; i++) { tam = s.nextInt(); s.nextLine(); text = s.next(); char [] a = text.toCharArray(); Arrays.sort(a); text = String.valueOf(a); dif = 0; if(tam == 5) { if (text.length() == 5 && text.equals("Timru")) { System.out.println("YES"); } else { System.out.println("NO"); } } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
1403d48d87388dee1ad36f2e09e61603
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class cf { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String name = "Timru"; int t = sc.nextInt(); while (t-- > 0) { int n = sc.nextInt(); String s = sc.next(); char[] str = s.toCharArray(); Arrays.sort(str); s = new String(str); if (name.equals(s)) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
e06c5c96bf3dc50d3aad9b83c6be1515
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Main{ public static void main(String[] args){ Scanner scn = new Scanner(System.in); int T = scn.nextInt(); while(T-->0){ int n = scn.nextInt(); scn.nextLine(); String str = scn.next(); int c1 = 0 , c2 = 0, c3 = 0, c4 = 0, c5 = 0; for(int i=0; i<str.length(); i++){ char ch = str.charAt(i); if(ch=='T') c1++; else if(ch=='i') c2++; else if(ch=='m') c3++; else if(ch=='u') c4++; else if(ch=='r') c5++; } if(c1==1 && c2==1 && c3==1 && c4==1 && c5==1 && str.length()==5) System.out.println("Yes"); else System.out.println("No"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d2c987b89e86524b13f0530546286532
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class solution{ public static void main(String[] args){ Scanner sc = new Scanner(System.in); int test = sc.nextInt(); while(test!=0){ String str2 = "Timru"; int n = sc.nextInt(); String str = sc.next(); char charArray[] = str.toCharArray(); Arrays.sort(charArray); String new_str= new String(charArray); if(new_str.equals(str2)){ System.out.println("YES"); } else{ System.out.println("No"); } test--; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d8beb2435f6e550eec0fcf4724d83ad4
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class one { public static void main(String args[])throws IOException { try { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); for(int i=1;i<=n;i++) { int a=sc.nextInt(); String s=sc.next(); if(s.contains("T")&&s.contains("i")&&s.contains("m")&&s.contains("u")&&s.contains("r")&&a==5) System.out.println("YES"); else System.out.println("NO"); } } catch(Exception e) { return; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
49b28fec6ebce2faac113ee3b77ebd2b
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; import java.io.*; public class A { public static void main(String [] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); String garbage = sc.nextLine(); while (n-- > 0) { int i = sc.nextInt(); String garbag2e = sc.nextLine(); String s = sc.nextLine(); if (i == 5 && s.contains("T") && s.contains("i") && s.contains("m") && s.contains("u") && s.contains("r")) { System.out.println("YES"); } else { System.out.println("NO"); } } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
89b26830472c639630f088ae65de8c94
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.HashSet; import java.util.Set; import java.util.StringTokenizer; public class Main { static FastReader in=new FastReader(); static PrintWriter out=new PrintWriter(System.out); static int n,m,zu; static void solve(){ m=in.nextInt(); String n=in.next(); char a[]=new char[128]; for(int i=0;i<n.length();i++) a[n.charAt(i)]++; if(a['T']==1&&a['i']==1&&a['m']==1&&a['u']==1&&a['r']==1&&n.length()==5){ out.println("YES"); }else{ out.println("NO"); } } public static void main(String[] args) { zu=in.nextInt(); while(zu-->0){ solve(); } out.flush(); out.close(); } static class FastReader{ StringTokenizer st; BufferedReader br; FastReader(){ br=new BufferedReader(new InputStreamReader(System.in)); } String next(){ while(st==null||!st.hasMoreElements()){ try { st=new StringTokenizer(br.readLine()); } catch (IOException e) { throw new RuntimeException(e); } } return st.nextToken(); } long nextLong(){ return Long.parseLong(next()); } double nextDouble(){ return Double.parseDouble(next()); } int nextInt(){ return Integer.parseInt(next()); } String nextLine(){ String str=""; try { str=br.readLine(); } catch (IOException e) { throw new RuntimeException(e); } return str; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
5d1e307c2322b7e5fd28ad29c39a77bb
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.*; public class Spell_Check { public static void main(String[] args) { ArrayList<Character> List = new ArrayList<Character>(Arrays.asList('t','i','m','u','r')); Scanner Scan = new Scanner(System.in); //System.out.println("Test Cases :"); int t = Scan.nextInt(); int r=0; while(r<t) { r++; //System.out.println("Enter n :"); int n = Scan.nextInt(); //System.out.println("Enrer s :"); String S = Scan.next(); String s = S.toLowerCase(); int e=0,f=0,g=0; for(int i=0; i<n; i++) { //STEP 1 if(n<6) { int e1=0; for(int j=0; j<n; j++) { if(s.charAt(j)==List.get(i)) e1++; } if(e1==1) e++; } //STEP 2 if(S.charAt(i)==116 || S.charAt(i)==84) { if(S.charAt(i)==116) f=1; else if(S.charAt(i)==84) f=2; } //STEP 3 if(S.charAt(i)>96) g++; } if(e==5 && f==2 && g==4) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
cdc6449159b2d8d686deef35fbdeec86
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class Solve { public static final String[] letters = new String[]{"T", "i", "m", "u", "r"}; public static void main(String[] args){ Scanner sc = new Scanner(System.in); int count = Integer.parseInt(sc.nextLine()); for(int i = 0; i < count; i++){ System.out.println(isTimur(Integer.parseInt(sc.nextLine()), sc.nextLine())); } } public static String isTimur(int len, String name){ if (len != 5) return "NO"; else { String[] lettersFromName = name.split(""); Arrays.sort(letters); Arrays.sort(lettersFromName); return Arrays.equals(lettersFromName, letters) ? "YES" : "NO"; } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
bc111ed87bd3af65feb31b3ce46c5b25
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class JavaApplication17 { public static void main(String[] args) { Scanner in=new Scanner(System.in); int x=in.nextInt(); for(int i=1;i<=x;i++) { int y=in.nextInt(); String s=in.next(); if(y!=5) { System.out.println("NO"); continue; } char charArray[] = s.toCharArray(); Arrays.sort(charArray); String ss=new String(charArray); String sss="Timru"; if(ss.equals(sss)) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output
PASSED
d04e9cba128dda84c1fe95790571ea9f
train_109.jsonl
1661871000
Timur likes his name. As a spelling of his name, he allows any permutation of the letters of the name. For example, the following strings are valid spellings of his name: Timur, miurT, Trumi, mriTu. Note that the correct spelling must have uppercased T and lowercased other letters.Today he wrote string $$$s$$$ of length $$$n$$$ consisting only of uppercase or lowercase Latin letters. He asks you to check if $$$s$$$ is the correct spelling of his name.
256 megabytes
import java.util.Arrays; import java.util.Scanner; public class JavaApplication17 { public static void main(String[] args) { Scanner in=new Scanner(System.in); int x=in.nextInt(); for(int i=1;i<=x;i++) { int y=in.nextInt(); String s=in.next(); char charArray[] = s.toCharArray(); Arrays.sort(charArray); String ss=new String(charArray); String sss="Timru"; if(ss.equals(sss)) System.out.println("YES"); else System.out.println("NO"); } } }
Java
["10\n\n5\n\nTimur\n\n5\n\nmiurT\n\n5\n\nTrumi\n\n5\n\nmriTu\n\n5\n\ntimur\n\n4\n\nTimr\n\n6\n\nTimuur\n\n10\n\ncodeforces\n\n10\n\nTimurTimur\n\n5\n\nTIMUR"]
1 second
["YES\nYES\nYES\nYES\nNO\nNO\nNO\nNO\nNO\nNO"]
null
Java 11
standard input
[ "implementation" ]
6c137a74b36dede61037cb3b05167329
The first line of the input contains an integer $$$t$$$ ($$$1 \leq t \leq 10^3$$$) — the number of test cases. The first line of each test case contains an integer $$$n$$$ $$$(1 \leq n \leq 10)$$$ — the length of string $$$s$$$. The second line of each test case contains a string $$$s$$$ consisting of only uppercase or lowercase Latin characters.
800
For each test case, output "YES" (without quotes) if $$$s$$$ satisfies the condition, and "NO" (without quotes) otherwise. You can output the answer in any case (for example, the strings "yEs", "yes", "Yes" and "YES" will be recognized as a positive answer).
standard output