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 | af14bde3ef939f63275052e48e3d3f46 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.*;
import java.io.*;
public class ZalgorithmString {
public static void main(String[] args) throws Exception{
BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
PrintWriter out = new PrintWriter(System.out);
String a = bf.readLine().trim();
int[] z = calculateZ(a.toCh... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 1425733250243464f2afc17f6424b71e | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
public class PrefixesAndSuffixes {
static int [] z(String str) {
char s[] = str.toCharArray();
int n = s.length;
int z[] = new int[n]... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | cf67c39659adf08ae0c4163c8b7a055e | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
public class PrefixesAndSuffixes {
public static int[] z(String s) {
int n = s.length();
int[] res = new int[n];
int l, r;
l = r... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 162de0fb7cb97dd059caedb64064261a | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Collection;
import java.util.LinkedList;
import java.util.Locale;
import java.util.StringTokenizer;
public class Main {
public static void main(String[] ar... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | de4e7c935c761ee97b4a745d269473f3 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | /**
* Created by Aminul on 10/17/2017.
*/
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class CF432D {
public static int n;
static char [] s;
public static void main(String[] args)throws Except... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 9f681469ad24a486faea08a3f87f80ea | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | /**
* Created by Aminul on 10/17/2018.
*/
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
public class CF432D_Hash_Test {
public static void main(String[] args)throws Exception {
FastReader in = new FastReader(System.in);
PrintWriter pw = new PrintWriter(System.out);
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | ec4e427c88d7453b399389f5fd3c3332 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.*;
import java.util.*;
import java.util.Map.Entry;
public class Problem_432D {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner();
PrintWriter pw = new PrintWriter(System.out);
char[]s=sc.nextLine().toCharArray();
int[]z=z(s);
// System.out.println(Arrays.to... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 81c644df78f2dce3c609525b9126b059 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | //package CodeForces;
import java.io.*;
import java.util.*;
import java.util.Map.Entry;
public class Problem_432D {
public static void main(String[] args) throws IOException {
Scanner sc = new Scanner();
PrintWriter pw = new PrintWriter(System.out);
char[]s=sc.nextLine().toCharArray();
int[]z=z(s);
// System... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | d733416c5ea54a880a8b34612b9ef43d | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.TreeMap;
import java.util.Map;
import java.util.Map.Entry;
import java.io.InputStream;
/**
* Built using CHelper plug-... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 96e538fc025706aaf92dae51aaf87d42 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.FilterInputStream;
import java.io.BufferedInputStream;
import java.util.Comparator;
import java.util.Collections;
import java.util.ArrayList;
import java.io.InputStream;
/**
* Built using CH... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | bd3cb93b6dcd088f51b8b5faca751966 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.*;
import java.io.IOException;
import java.util.*;
//import javafx.util.Pair;
//import java.util.concurrent.LinkedBlockingDeque;
//import sun.net.www.content.audio.wav;
public class Codeforces {
public static long mod = (long)Math.pow(10, 9)+7 ;
public static doubl... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 1d8f46e7b00d459343228de4c465f76f | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Stack;
public class Main {
public static void main(String[] args) throws IOException {
//Scanner sc = new Scanner(System.in);
BufferedReader reader = new BufferedReader(ne... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 5a23f127363f3ffaf40da3da0b067301 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.BigInteger;
public class tr0 {
static PrintWriter out;
static StringBuilder sb;
static int mod = 1000000007;
static long inf = (long) 1e16;
static int n, m;
static ArrayList<Integer>[] ad;
static long[][][] memo;
static boolean f;
static boolean vis[];
s... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | d8a05503b9749869a2dbef297ea696f3 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.OutputStream;
import java.io.InputStreamReader;
import java.io.FileNotFoundException;
import java.io.File;
import java.util.ArrayList;
import java.util.StringTokenizer;
import java.io.Writer;
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 5c2a434569e69bc45b9f69760c953e2d | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | /*
Method 2: Using KMP, as per the editorial.
Though the Z-function approach is way simpler, and more intuitive.
Checking for prefix suffix match is pretty straightforward:
p[|s|], p[p[|s|]], p[p[p[|s|]]], etc.
Finding count of all occurrences of all prefixes (why it works):
edge from pi[v] to... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 848a17b25625b4ee78c313b8c4f50be4 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | //created by Whiplash99
import java.io.*;
import java.util.*;
public class A
{
private static void computeZArr(char str[], int z[])
{
int l = 0, r = 0, N = str.length;
for (int i = 1; i < N; i++)
{
if (i <= r)
z[i] = Math.min(r - i + 1, z[i - l]);
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 31264873eaba1590b485dbbeb7f1dc1e | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | //created by Whiplash99
import java.io.*;
import java.util.*;
public class A
{
static class Hashing
{
long[] hash,pow;
long P, MOD;
int N;
Hashing(char str[], long P, long MOD)
{
this.N=str.length;this.P=P;this.MOD=MOD;
hash=new long[N+1];pow=new ... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 21475e159b9e3596e26e7894a1b8151a | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.*;
import java.io.*;
public class PrefixesAndSuffixes
{
public static void main(String[] args){
Scanner scan = new Scanner(System.in);
PrintWriter out = new PrintWriter(System.out);
char[] s = scan.next().toCharArray();
int n = s.length;
int[] ans = new int[n+2];
int[] z = zValues(s);... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | e03611a7a26dbe36cd8163867c5cbe09 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.io.InputStreamReader;
import java.util.function.IntPredicate;
import java.util.AbstractCollection;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | f20f017c06d4d653d1c7552e210784b7 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author dipankar12
*/
import java.io.*;
import java.util.*;
public class r246d {
void computelpsarray(String str,int le... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | a559ba902cd3e402aef6b03eee2a6f7b | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.StringTokenizer;
import java.io.BufferedReader;
import java.io.InputStream;
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | f9a4ec9cc0977f298b05cef577b30fc1 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.*;
import java.lang.reflect.Array;
import java.math.*;
import java.util.*;
public class icpc
{
public static void main(String[] args)throws IOException
{
//Reader in = new Reader();
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
String s = in.r... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 7115f1194cf26cd5337e84c29e2c6b28 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.*;
import java.io.*;
public class PrefixesandSuffixes {
/************************ SOLUTION STARTS HERE ************************/
static int[] KMPPrefixFunction(char str[]) {
int n = str.length;
int prefix[] = new int[n]; // Stores the length of largest bord... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 75fe334e27dea61d7b99a276a05ce8ab | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.Scanner;
public class _29_Prefixes_and_Suffixes {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
String s = scn.next();
int[] z = new int[s.length()];
int[] count = new int[s.length() + 1];
getZarr(s, z);
int k = 0;
for (int i = 0; i < z.length; i++) {
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 4c562fcf212753c1eadde4679701247a | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.InputMismatchException;
public class Main {
InputStream is;
PrintWriter out;
String INPUT = "";
void solve() {
char[] s = ns().toCharArray();
int[]... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 348bf88f28d0a3d646288e56c7398710 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | // ONE DAY, YOU WILL BE BEYOND THE REACH OF SPACE AND TIME. //
// UNTIL THEN, STAY LOW AND CODE HARD. //
// Author :- Saurabh//
//BIT MESRA, RANCHI//
import java.io.*;
import java.util.*;
import static java.lang.Math.*;
public class prefixesAndSuffixes {
static void Bolo_Jai_Mata_Di() {
char ch[]=(" "+ns... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 669cf5f952d7f4771b85b13529d888bc | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | /**
* BaZ :D
*/
import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Main
{
static MyScanner scan;
static PrintWriter pw;
public static void main(String[] args) {
new Thread(null,null,"BaZ",1<<25)
{
public void run()
{
t... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 2b3a8efafbd1a91c78cde9a4ebbca19a | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.TreeSet;
public class _432D
{
public static void main(String[] args) throws IOException
{
InputStreamReader isr = new InputStreamReader(System.in);
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 65bdfe021c036815379fecf4e61183d6 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.*;
public class Main{
static long MOD=(int)1e9+7;
static int MAXN=1010;
static long ncr[][]=new long[MAXN+4][MAXN+4];
public static void main(String args[]){
Scanner sc=new Scanner(System.in);
String s=sc.next();
int z[]=zfun(s);
int cnt[]=new int[s.... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | b3b83d36d8c93c6a067a03c7d28922cb | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;
/* spar5h */
public class cf4 implements Runnable{
static class tuple {
int i, x, y;
public tuple(int i, int x, int y) {
this.i = i; this.x = x; this.y = y;
}
}
static class comp implements Comparator<tuple> {
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 09500a76e6a177f330f21ed1b7d9bb6b | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.*;
import java.util.*;
public class b {
public static void main(String[] args) throws IOException, InterruptedException {
Scanner zizo = new Scanner(System.in);
PrintWriter wr = new PrintWriter(System.out);
char[]c = zizo.next().toCharArray();
int[] z = zAlgo(c);
ArrayList<Integer> a= ne... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | ec5baba1603cf621ca4783604fcb5bb4 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;
/**
* Built using CHelper plug-in
* Actual solution is at the top
*
* @author Ribhav
*/
public class Mai... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 8fece586ae577fa82396c41ce7786573 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.*;
import java.util.*;
public class A implements Runnable{
public static void main (String[] args) {new Thread(null, new A(), "", 1 << 28).start();}
public void run() {
FastScanner fs = new FastScanner();
PrintWriter out = new PrintWriter(System.out);
char[] a = fs.nextCharArray();
int n = a... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | 55cda523a597c1464ab296f7409a66e2 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Round246D {
public static class HashingUtility {
//If tle comes we can reduce number of hashes to even two...
... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | e18753a39f9310353fcdbdd0e809d806 | train_003.jsonl | 1400167800 | You have a string sβ=βs1s2...s|s|, where |s| is the length of string s, and si its i-th character. Let's introduce several definitions: A substring s[i..j] (1ββ€βiββ€βjββ€β|s|) of string s is string sisiβ+β1...sj. The prefix of string s of length l (1ββ€βlββ€β|s|) is string s[1..l]. The suffix of string s of length l (1β... | 256 megabytes | import java.util.Scanner;
import java.util.Stack;
public class Main {
private static int[][] dfa = new int[27][100_005]; // the KMP automoton
static int[] pref;
/**
* Preprocesses the pattern string.
*
* @param pat
* the pattern string
*/
public static void KMP(String pat) {
int m = pat.le... | Java | ["ABACABA", "AAA"] | 1 second | ["3\n1 4\n3 2\n7 1", "3\n1 3\n2 2\n3 1"] | null | Java 8 | standard input | [
"dp",
"two pointers",
"string suffix structures",
"strings"
] | 3fb70a77e4de4851ed93f988140df221 | The single line contains a sequence of characters s1s2...s|s| (1ββ€β|s|ββ€β105) β string s. The string only consists of uppercase English letters. | 2,000 | In the first line, print integer k (0ββ€βkββ€β|s|) β the number of prefixes that match a suffix of string s. Next print k lines, in each line print two integers li ci. Numbers li ci mean that the prefix of the length li matches the suffix of length li and occurs in string s as a substring ci times. Print pairs li ci in t... | standard output | |
PASSED | ce7d9ee18a57ed4179781264448c8d6f | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.* ;
public class A {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
StringBuilder sb = new StringBuilder();
int t = sc.nextInt();
while(t-->0) {
String a = sc.next(),b=sc.next(),c=sc.next();
sb.append((solve(a,b,c) ? "YES" : "NO") + "\n");
}
Syst... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | c9b5b85c528c02dcfe84d31b86198cf8 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
public class cpts {
public static void main (String[] args) {
Scanner in = new Scanner(System.in);
int T=in.nextInt();
for(int t=0;t<T;t++) {
String a = in.next();
String b = in.next();
String c = in.next();
for (int i = 0; ... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | d5a1b3b8d2b734b744d4abe1e1c6d5d6 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.Scanner;
public class Chatroom {
public static void main(String[] args)
{
Scanner s=new Scanner(System.in);
int t=s.nextInt();
while(t-->0)
{ int flag=0;
String a=s.next();
String b=s.next();
String c=s.next();
char []a1=a.toCharArray();
char []b1=b.toCharArray();
char... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | c8cca821b0a9510b56043a3055fba8aa | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main{
public static void main(String []args)throws Exception{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
int T=Integer.parseInt(br.readLine());
while(T-- > 0){
String a=br.readLine();
Stri... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 052417b273f37e1cf6a997c672ab4761 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.*;
import java.util.*;
public class MyClass {
public static void main(String args[]) {
FastReader sc = new FastReader(); //For Fast IO
//func f = new func(); //Call func for swap , permute, upper bound and for sort.
StringBuilder sb = new StringBuilder();
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 7708fd3b3e8edfe3ab7b47b886e128b7 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | /* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
public class Ideone
{
public static void main (String[] args) throws java.lang.Exception
{
// your code goes here
Scanner sc=new Sc... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | de9cd7b24bb3fe72508075eba27f7d2e | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Solution {
public static void main(String [] args) throws NumberFormatException, IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine())... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | de759058bed16e369cfee565ae6e58a9 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.InputMismatchException;
public class A {
public static void main(String[] args) throws Exception {
// TODO Auto-generated method stub
InputReader s = new InputReader(System.in);
Print... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 8aee5637b8733219b063840021ab912e | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
// StringTokenizer st = new StringTokenizer(br.readLine());
// int x = Integer.parseInt(st.nextToken());
int T = Intege... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | aa947723f4ae0f4a43bee7bb4d5ce792 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
public class NewClass{
public static void main(String sdf[]){
Scanner in = new Scanner(System.in);
int t = in.nextInt();
in.nextLine();
while(t-->0){
String a = in.nextLine();
String b = in.nextLine();
String c = in.nextLin... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 298a42d8f0473689cfeaf3c0ee7ddd9d | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.ArrayList;
import java.awt.Dimension;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Obj... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | e15c56cb0d8661f5f7e9905776af08ba | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.*;
import java.math.*;
import java.security.*;
import java.text.*;
import java.time.LocalTime;
import java.util.*;
import java.util.concurrent.*;
import java.util.regex.*;
public class Main {
public static void main(String[] args) {
FastScanner scan = new FastScanner();
int t... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 2a2bb7eab7fe6b325cab23c7fc9ac7d0 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 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 s1=sc.next();
String s2=sc.next();
String s3=sc.next();
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 6f49e14388edb47bf15a4a1315db8fe6 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.*;
public class P1301A_ThreeStrings {
public static void main(String subhani[]) throws IOException, NumberFormatException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int t = Integer.parseInt(br.readLine());
while (t-- > 0) {
String a = br.readLine(), b = br.read... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | d64e4fa2812cb925217b570c43b88c67 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.Scanner;
public class S {
public static void main(String[] args) {
// write your code here
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
try
{
for(int i=0;i<t;i++)
{
String a=sc.next();
String b=sc.n... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 628ca4763c108958a3159d5cb67563a7 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | //package com.company;
import java.util.Scanner;
public class Main {
static boolean solve(String a, String b, String c) {
for (int i = 0; i < a.length(); i++) {
char ac = a.charAt(i);
char bc = b.charAt(i);
char cc = c.charAt(i);
if (ac != cc && bc != cc) ... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 66733b77b1e7c70c06e57f7c7d5d17c8 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.io.*;
public final class Solution
{
public static boolean isPossible(String a,String b,String c,int n)
{
int cnt = 0;
for(int i=0;i<n;i++)
{
if(a.charAt(i) == b.charAt(i))
{
if((c.charAt(i) == b.charAt(i)))
continue;
else
return false;
}
else if(a.c... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 55ed1c7cddcee1801c5a22e427322452 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.Scanner;
// import java.util.ArrayList;
// import java.util.Arrays;
// import java.util.HashMap;
// import java.util.HashSet;
public class ans1{
static int mod = (int)10e8;
public static int lower(int arr[],int key){
int low = 0;
int high = arr.length-1;
while(low < ... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 0b26af32d42dc1420c17197f63ea1804 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
public class MyClass {
public static void main(String args[]) {
Scanner in=new Scanner(System.in);
int t=in.nextInt();
for(int j=0;j<t;j++){
char a[]=in.next().toCharArray();
char b[]=in.next().toCharArray();
char c[]=in.next().toCharAr... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | ba07554714cfa92d6449e14297905c0c | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.io.*;
public class A{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-->0) {
char a[] = sc.next().toCharArray();
char b[] = sc.next().toCharArray();
char[] c = sc.next().toCharArray();
boolean flag = true;
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 47c215bec58d0703d3871dc189e841fd | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes |
import java.util.Scanner;
public class Main{
public static void main(String[] args)
{
Scanner scan = new Scanner(System.in);
int t = scan.nextInt();
while(t-->0)
{
String a = scan.next(),b=scan.next(),c=scan.next();
int n=a.length();
boolean x = true;
for(int i=0;i<n;i++)
{
char ai = a.... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 9db88c0c2f0cdb6ee271a37ce7040929 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.Scanner;
public class Main{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String s=input.nextLine();
int n=Integer.parseInt(s);
String[][] x=new String[n][3];
for(int i=0; i<n; i++){
for(int j=0; j<3; j++)
{x[i][j]=input.... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 8e767d410f7268586e8ba3d84899a361 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes |
import java.util.Scanner;
public class Threestring {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
while (t!=0){
String a=sc.next(),b=sc.next(),c=sc.next();
boolean bb=true;
for (int i = 0; i < a.length(); i++) {
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | dfbf649f3f87d565cf801575fb633d1c | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
public static void main(String[] args) {
FastScanner scr = new FastScanner();
int t = scr.nextInt();
while (t-- > 0) {
solve(scr);
}
}
static void solve(FastScanner scr) {
String aa = scr.nextToke... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 359c964b04ed20466eb75dcbb073a21b | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.Scanner;
public class pre108
{
public static void main(String args[])
{
Scanner obj = new Scanner(System.in);
int tc = obj.nextInt();
while(tc--!=0)
{
char[] s1 = obj.next().toCharArray(), s2 = obj.next().toCharArray(), s3 = obj.next().toCharArray();... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 58ef02f9c2f9973b6b34b1f522771678 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | //package com.company.CompititivePrograming;
import java.io.*;
public class ThreeStrings {
public static void main(String args[])throws IOException {
BufferedWriter out=new BufferedWriter(new OutputStreamWriter(System.out));
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 3b2989d0e561812f7cc3038dd110b231 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.*;
public class A {
private static String a, b, c = null;
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
Str... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 7dbcde2a619aa725efffa2013cb01795 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
public class ThreeStrings {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
sc.nextLine();
while(t-->0) {
String a=sc.nextLine();
String b=sc.nextLine();
String c=sc.nextLine();
int n=a.length();
boolean ans=isTrue(a,b,c,n)... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | b98fcfe042a0f5aa10c031cd9271d97c | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.lang.Math.*;
public class Contests {
public static void nl(){
System.out.println();
}
public static Scanner sc = new Scanner(System.in);
public static int rdint(){
return sc.nextInt();
}
public static double rddbl(){
return sc.nextDouble()... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 8a762ed58e4ce5037ae4e011575974a4 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | //package codeforces;
public class ThreeStrings {
public static void main(String[] args) {
int t;
String a, b, c;
java.util.Scanner sc = new java.util.Scanner(System.in);
t = sc.nextInt();
while(t-- != 0) {
a = sc.next();
b = sc.next();
c = sc.next();
int flag = 0;
for(int i = 0; i < a.length... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | d52778760f98a6cadb3d3fbd6a7c60d6 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.io.*;
import static java.lang.Math.*;
public class Scanner_ {
//global methods
static class MyReader {
BufferedReader br;
StringTokenizer st;
public MyReader() {
br = new BufferedReader(new
InputStreamReader(System.in));
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | c936f2b705215c974eff36c03dbc8890 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.lang.*;
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 a=sc.next();
String b=sc.next();
String c=sc.next();
char[] a1=a.toCharArray();
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 4bf591b32634238cd8573ac07e8e8f3d | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.*;
public class Test{
public static void main(String[] args)throws Exception {
int t;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
t = Integer.parseInt(br.readLine());
while(t-- >0){
String a,b,c;
a = br.readLine();
b = br.readLine();
c = br.readLine();
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 0e5d1517b35393445431d6876be92fb8 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
public class SST
{
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int n=sc.nextInt();
while(n-->0)
{
String a=sc.next();
String b=sc.next();
String c=sc.next();
int f=0;
for(int i=0;i<a.length();i++)
{
if(!(c.charAt(i)==a.charAt(i) || c.c... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | a054efefafc3dcc54df88cea0370d17b | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.*;
import java.util.*;
public class ths{
public static void main(String []args){
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
while(n-->0){
String a=sc.next();
String b=sc.next();
String c=sc.next();
int f=0;
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 056034feb5424d53327dde722282795c | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
public class file{
public static void main(String[ ] args){
Scanner s=new Scanner(System.in);
int test =s.nextInt();
s.nextLine();
for(int i=0;i<test ;i++){
String a=s.nextLine();
String b=s.nextLine();
String c=s.nextLine();
boolean flag =true;
for(int j=0;j<c.length() ;j++){
if(a.charAt(j)==c.... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 0c37a3843a8f5557923cd35f9005f623 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | //https://codeforces.com/contest/1301/problem/0
import java.util.Scanner;
public class Problem_1301_A {
private static Scanner scanner = new Scanner(System.in);
public static void main(String[] args) {
int t = scanner.nextInt();
scanner.nextLine();
while (t-->0){
String a... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | d111e6cf2128f108de1631f77e309562 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.util.spi.LocaleNameProvider;
import java.io.*;
public class Main
{
public static void main(String[] args) throws Exception {
Scanner sc = new Scanner(System.in);
PrintWriter pw = new PrintWriter(System.out);
int t=sc.nextInt();
for(int i=0;i<t;i++) {
String a=sc.next()... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 05b0150e33d9547e5e75556ac4390fd8 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | /*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
//package tester;
import java.util.*;
import java.io.*;
public class Tester {
static int mod = (int)1e9+7;
public static void ... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 0288e820f1546886d3db114db5d2f48e | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes |
import java.util.Scanner;
public class First1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t!=0){
String a = sc.next();
String b = sc.next();
String c = sc.next();
int c1 =0;
for(int i=0;i<a.length();i++){
if((a... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 6185285e8dc63427c88ae3905bad27fc | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes |
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.Queue;
import java.util.StringTokenizer;
public class Problem2 {
public int find(int pr[],int i) {
if(i==pr[i])
return i;
else
{
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | ab4d0175a0c0162587555af14067cbdd | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class ThreeStrings {
public static void main(String[] args) {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
int t = 0;
try {
t = Integer.parseInt(... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 832c08e16870bca9338ab3ea5ce4a2f4 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.io.*;
import java.math.*;
public class sample
{
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(new
InputStreamReader(System.in));
}
... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 71044ec2a91ae4db96a9f93f403958f4 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | //package codeforces;
import java.util.Scanner;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.TreeMap;
import java.util.TreeSet;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Stack;
im... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 68982ae8169a43cac7eec11087ce9689 | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.*;
import java.io.*;
public class CFE {
BufferedReader br;
PrintWriter out;
StringTokenizer st;
boolean eof;
private static final long MOD = 1000L * 1000L * 1000L + 7;
private static final int[] dx = {0, -1, 0, 1};
private static final int[] dy = {1, 0, -1, 0};
private ... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | 814894c6bad036ee5ebda55cdcd0203a | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes | import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;
public class medo
{
public static void main (String[] args)
{
Scanner sc=new Scanner(System.in);
int t,i;
t=sc.nextInt();
while(t>0)
{
t--;
char a[]=sc.next().toCharArray();
char b[]=sc.next().toCharArray();
char c[... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | b55b3a4ec0a0501efee7dd8d9cf953eb | train_003.jsonl | 1581604500 | You are given three strings $$$a$$$, $$$b$$$ and $$$c$$$ of the same length $$$n$$$. The strings consist of lowercase English letters only. The $$$i$$$-th letter of $$$a$$$ is $$$a_i$$$, the $$$i$$$-th letter of $$$b$$$ is $$$b_i$$$, the $$$i$$$-th letter of $$$c$$$ is $$$c_i$$$.For every $$$i$$$ ($$$1 \leq i \leq n$$$... | 256 megabytes |
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.*;
import java.io.*;
public class Main {
public static void main(String args[]) {
InputReader obj = new InputReader(System.in);
int t=obj.ne... | Java | ["4\naaa\nbbb\nccc\nabc\nbca\nbca\naabb\nbbaa\nbaba\nimi\nmii\niim"] | 1 second | ["NO\nYES\nYES\nNO"] | NoteIn the first test case, it is impossible to do the swaps so that string $$$a$$$ becomes exactly the same as string $$$b$$$.In the second test case, you should swap $$$c_i$$$ with $$$a_i$$$ for all possible $$$i$$$. After the swaps $$$a$$$ becomes "bca", $$$b$$$ becomes "bca" and $$$c$$$ becomes "abc". Here the stri... | Java 8 | standard input | [
"implementation",
"strings"
] | 08679e44ee5d3c3287230befddf7eced | The input consists of multiple test cases. The first line contains a single integer $$$t$$$ ($$$1 \leq t \leq 100$$$) Β β the number of test cases. The description of the test cases follows. The first line of each test case contains a string of lowercase English letters $$$a$$$. The second line of each test case contain... | 800 | Print $$$t$$$ lines with answers for all test cases. For each test case: If it is possible to make string $$$a$$$ equal to string $$$b$$$ print "YES" (without quotes), otherwise print "NO" (without quotes). You can print either lowercase or uppercase letters in the answers. | standard output | |
PASSED | f5b74905d71dba5628d05bc76be28d36 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.ArrayList;
import java.util.Scanner;
public class CF_1208A {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
int T=sc.nextInt();
while(T-->0) {
int a=sc.nextInt(),b=sc.nextInt(),n=sc.nextInt();
int c=a^b;
if(n%3==0) {
System.out.println(a);
}
else ... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | e6f3a5b743851c1d34d723c3a9a60638 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.Input... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 57ea35c625d0aacc4ab6fe73966c8031 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
int t=in.nextInt();
for(int i=0;i<t;i++)
{
int a=in.nextInt();
int b=in.nextInt();
int n=in.nextInt();
... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 116076f1e17fb690fa1b77d8fdb51db7 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main{
public static void main(String args[])
{
Scanner sc = new Scanner(System.in);
int t;
t = sc.nextInt();
while(t>0)
{
int a = sc.nextInt();
int b = sc.nextInt();
int n = sc.nextInt();
n%=3;
... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | e20b5d2776bf3e8b089fe84e761c0c4e | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.Scanner;
public class Scratch {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
for(int i=0;i<t;i++){
int a = sc.nextInt();
int b = sc.nextInt();
int n = sc.nextInt();
if(n%3... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 7692fe904b0c41e539b23ce0c4257b47 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 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();
int b = sc.nextInt();
long c = sc.nextLong();
long n =... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 168fcdb171772327d506edbad580fdbf | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 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();
int b = sc.nextInt();
long c = sc.nextLong();
long n =... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | a9b8a2aaf3f95e5ebaaeec544b89ee7d | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes |
import java.util.Scanner;
public class XORinacci {
/* public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t > 0) {
int a = sc.nextInt();
int b = sc.nextInt();
int n = sc.nextInt();
if (n == 0 || n == 1) {
if (n == 0... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | a07169b333dae6b68dd68014a10f5fc7 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes |
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner Input = new Scanner(System.in);
int N = Input.nextInt();
for (int I = 0; I < N; I++) {
int[] Arr = new int[3];
Arr[0] = Input.nextInt();
Arr[1] = Input.nextIn... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 5bbfb2235925cf0076922de2c762f666 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.io.*;
import java.util.*;
import java.math.*;
//import java.lang.*;
public class snack4
{
static class Reader
{
final private int BUFFER_SIZE = 1 << 16;
private DataInputStream din;
private byte[] buffer;
private int bufferPointer, bytesRead;
pub... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 16214c05ae91df67fd5bbcab05a17b2d | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | // Working program with FastReader
import java.io.*;
import java.util.*;
import java.text.*;
import java.math.*;
public final class Main
{
static class FastReader
{
BufferedReader br;
StringTokenizer st;
public FastReader()
{
br = new BufferedReader(new
InputStreamReader(System.in));
}... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | f34bc5f20c38464be576c93ee611044e | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.*;
public final class Main{
/* static int f(int n,int a,int b){
if(n==0)
return a;
else if(n==1)
return b;
return f(n-1,a,b)^f(n-2,a,b);
}*/
public static void main(String[] args){
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | d8c69e019e7e82f124411ffaf45b3201 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.*;
import java.io.*;
public class Main {
public static void main(String[] args) throws IOException{
Scanner sc = new Scanner(System.in);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
OutputStream pr = System.out;
PrintWriter out = new Pr... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 37acac10b9fdd49e8173a8a99b993e11 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.Scanner;
public class q1 {
public static void main(String[] args) {
int n,a,b;
// System.out.println((4^(7^4))^(4^7)^(4^(7^4)));
// System.out.println(4^(4^7));
// a=265;
// b=325;
// int c;
// for(int j=2;j<=10;j++){
// c=a^b;
// ... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 349a94b42a8470b62332cd56c0813e5f | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.io.*;
import java.util.*;
public class Main {
private static final int MAX = Integer.MAX_VALUE;
private static final int MIN = Integer.MIN_VALUE;
public static void main(String[] args) throws IOException {
InputStream inputStream = System.in;
OutputStream outputStream = System.... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 23b203224efb930aefb0c29595fbf41b | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.io.*;
import java.util.*;
public class Solution
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
int t=sc.nextInt();
for(int i=0;i<t;i++)
{
int a=sc.nextInt();
int b=sc.nextInt();
int n=sc.nextInt();
int temp=a^b;
int c=n%3;
if(c==0)
System.out.println(a);
if(c==1)
... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | e2025fe517848ca556b4e004a2bdc708 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.*;
public class Main{
public static void main(String ... strings){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while(t-- > 0){
int a = sc.nextInt() , b = sc.nextInt() , c = sc.nextInt();
if(c % 3 == 0) System.out.printl... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output | |
PASSED | 1bbc41b1ee2ee98fa77e93dbcd721d28 | train_003.jsonl | 1566743700 | Cengiz recently learned Fibonacci numbers and now he is studying different algorithms to find them. After getting bored of reading them, he came with his own new type of numbers that he named XORinacci numbers. He defined them as follows: $$$f(0) = a$$$; $$$f(1) = b$$$; $$$f(n) = f(n-1) \oplus f(n-2)$$$ when $$$n &... | 256 megabytes | import java.util.ArrayList;
import java.util.HashMap;
import java.util.Scanner;
public class codefest19 {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner s = new Scanner(System.in);
int t = s.nextInt();
while (t-- > 0) {
int a = s.nextInt();
int b = s.nextInt();
i... | Java | ["3\n3 4 2\n4 5 0\n325 265 1231232"] | 1 second | ["7\n4\n76"] | NoteIn the first example, $$$f(2) = f(0) \oplus f(1) = 3 \oplus 4 = 7$$$. | Java 8 | standard input | [
"math"
] | 64a375c7c49591c676dbdb039c93d218 | The input contains one or more independent test cases. The first line of input contains a single integer $$$T$$$ ($$$1 \le T \le 10^3$$$), the number of test cases. Each of the $$$T$$$ following lines contains three space-separated integers $$$a$$$, $$$b$$$, and $$$n$$$ ($$$0 \le a, b, n \le 10^9$$$) respectively. | 900 | For each test case, output $$$f(n)$$$. | standard output |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.