B1. Xor Pairs (Easy Version)

Codeforces
IDCFB1
Time1000ms
Memory256MB
Difficulty
English · Original
Chinese · Translation
Formal · Original
You are given an array of $n$ integers (a1, a2, a3, ....... an) You have to find the number of pairs such that a[i] xor a[j] = a[i] First line has a single integer $t$, number of tests [1 <= $t$ <= 10] First line of each test has a single integer $n$, size of array [1 <= $n$ <= 100] Second line of each test has $n$ integers, the array elements [0 <= $a [ i ]$ <= 1e9] It is guaranteed that sum of n among all tests do not exceed 100 For each test, print a single integer, the number of pairs ## Input First line has a single integer $t$, number of tests [1 <= $t$ <= 10]First line of each test has a single integer $n$, size of array [1 <= $n$ <= 100]Second line of each test has $n$ integers, the array elements [0 <= $a [ i ]$ <= 1e9]It is guaranteed that sum of n among all tests do not exceed 100 ## Output For each test, print a single integer, the number of pairs [samples]
给你一个正整数序列。一个正整数序列被称为 #cf_span[Rasta - made],当且仅当其中任意两个相邻元素互质。 对一个序列执行一次 #cf_span[Rasta - making] 操作,是指选择一对不互质的相邻元素,并将它们同时除以它们的一个公共质因数。例如,我们可以通过对序列执行一次操作将其变为 。 一个序列的 #cf_span[Phoulady] 数是指将其变为 #cf_span[Rasta - made] 序列所需的最少 #cf_span[Rasta - making] 操作次数。 一个序列的 #cf_span[Construction] 数是指通过执行 0 次或多次 #cf_span[Rasta - making] 操作所能得到的不同序列的数量。 我们用 #cf_span[F] 表示 #cf_span[Phoulady] 数,用 #cf_span[S] 表示 #cf_span[Construction] 数。 在所有子任务中: 子任务: 每个子任务包含一个测试用例。 输入包含两个整数 #cf_span[n] 和 #cf_span[M]。 请输出答案对 #cf_span[109 + 7] 取模的结果,占一行。 ## Input 每个子任务包含一个测试用例。输入包含两个整数 #cf_span[n] 和 #cf_span[M]。 ## Output 请输出答案对 #cf_span[109 + 7] 取模的结果,占一行。 [samples]
**Definitions** Let $ n \in \mathbb{Z}^+ $ be the number of students and marks. Let $ X = (x_1, x_2, \dots, x_n) $ be the sequence of mark distances, with $ 1 \leq x_1 < x_2 < \dots < x_n \leq 12345 $. Let $ C = (c_1, c_2, \dots, c_n) $ be the sequence of student skill levels, with $ 1 \leq c_i \leq 12345 $. **Constraints** Each student $ i $ can successfully shoot from a mark at distance $ x_j $ if and only if $ c_i \geq x_j $. Each mark must be assigned to exactly one student, and each student to exactly one mark (bijection). **Objective** Determine whether there exists a permutation $ \sigma \in S_n $ such that for all $ i \in \{1, \dots, n\} $: $$ c_i \geq x_{\sigma(i)} $$
API Response (JSON)
{
  "problem": {
    "name": "B1. Xor Pairs (Easy Version)",
    "description": {
      "content": "You are given an array of $n$ integers (a1, a2, a3, ....... an) You have to find the number of pairs such that a[i] xor a[j] = a[i] First line has a single integer $t$, number of tests [1 <= $t$ <= ",
      "description_type": "Markdown"
    },
    "platform": "Codeforces",
    "limit": {
      "time_limit": 1000,
      "memory_limit": 262144
    },
    "difficulty": "None",
    "is_remote": true,
    "is_sync": true,
    "sync_url": null,
    "sign": "CFB1"
  },
  "statements": [
    {
      "statement_type": "Markdown",
      "content": "You are given an array of $n$ integers (a1, a2, a3, ....... an)\n\nYou have to find the number of pairs such that a[i] xor a[j] = a[i]\n\nFirst line has a single integer $t$, number of tests [1 <= $t$ <= ...",
      "is_translate": false,
      "language": "English"
    },
    {
      "statement_type": "Markdown",
      "content": "给你一个正整数序列。一个正整数序列被称为 #cf_span[Rasta - made],当且仅当其中任意两个相邻元素互质。\n\n对一个序列执行一次 #cf_span[Rasta - making] 操作,是指选择一对不互质的相邻元素,并将它们同时除以它们的一个公共质因数。例如,我们可以通过对序列执行一次操作将其变为 。\n\n一个序列的 #cf_span[Phoulady] 数是指将其变为 #cf_sp...",
      "is_translate": true,
      "language": "Chinese"
    },
    {
      "statement_type": "Markdown",
      "content": "**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of students and marks.  \nLet $ X = (x_1, x_2, \\dots, x_n) $ be the sequence of mark distances, with $ 1 \\leq x_1 < x_2 < \\dots < x_n \\leq 123...",
      "is_translate": false,
      "language": "Formal"
    }
  ]
}
Full JSON Raw Segments